Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 10-18-2020, 02:07 PM   #1951
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,851
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I will give that a try. I've just used Kobo completely unmodded.
ownedbycats is online now   Reply With Quote
Old 10-18-2020, 03:36 PM   #1952
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,985
Karma: 56143930
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I use the other end of the USB cable or if the device is the only thing on my Powered USB HUB: Cycle the power (Off untill Windowsacknoledges device went away :beep)
theducks is offline   Reply With Quote
Advert
Old 10-18-2020, 09:21 PM   #1953
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by compurandom View Post
While I'm thinking about it...
The "store bookmark if more recent" is useful, but I'd also like a "store bookmark if further in the book" if that's possible.

Having two devices, the "more recent" is not necessarily the best location, assuming I'm reading a book sequentially.
I have considered that, but, the problem is defining "further in the book". The percent read isn't enough as it is an integer. Any book longer than 100 pages (it doesn't matter what definition of pages you use) will mean that you have to turn multiple pages to go up by 1%. How do you differentiate between the device at the first page of 25% and the last page of 25%? And what if you reread a book?

You could use the location. But, that would mean it had to be stored. And then you would need to work out which file within the book came first. Which means opening the book. And if you read epub on one device and kepub on another, that has to be handled as well (and I occasionally do, but usually so I can sync to the phone).

This is what the update prompt is for. From it, you can decide if you don't want to update the reading status for a book from the current device.
davidfor is offline   Reply With Quote
Old 10-18-2020, 11:41 PM   #1954
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,483
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@davidfor:

I've had a weird issue since the Series tab was introduced whereas the metadata migration apparently failed to pickup everything properly, so I've essentially ended up with a lot of stuff with a series set, but no index.

The plugin's update on device metadata thingy didn't help, because the check was failing.

This fixes it on my end:

Code:
diff -NuarpZ KU_2.11.8/action.py KU/action.py
--- KU_2.11.8/action.py 2020-10-19 05:35:00.760538753 +0200
+++ KU/action.py        2020-10-19 05:32:18.913540567 +0200
@@ -3773,14 +3773,16 @@ class KoboUtilitiesAction(InterfaceActio
 
                         if self.supports_series and self.options['series']:
                             debug_print("_update_metadata: self.options['series']", self.options['series'])
-                            debug_print("_update_metadata: newmi.series=", newmi.series, "newmi.series_index=", newmi.series_index)
+                            debug_print("_update_metadata: newmi.series=", newmi.series, "newmi.series_index=", newmi.series_index, "newmi.series_index_string=", newmi.series_index_string)
                             debug_print("_update_metadata: result['Series'] ='%s' result['SeriesNumber'] =%s" % (result["Series"], result["SeriesNumber"]))
                             debug_print("_update_metadata: result['SeriesID'] ='%s' result['SeriesNumberFloat'] =%s" % (result["SeriesID"], result["SeriesNumberFloat"]))
                             debug_print("_update_metadata: result['Series'] == newmi.series =", (result["Series"] == newmi.series))
                             series_index_str = ("%g" % newmi.series_index) if newmi.series_index is not None else None
+                            debug_print("_update_metadata: series_index_str=", series_index_str)
+                            debug_print('_update_metadata: (newmi.series_index_string is not None and result["SeriesNumber"] == newmi.series_index_string) =', (newmi.series_index_string is not None and result["SeriesNumber"] == newmi.series_index_string))
                             debug_print('_update_metadata: result["SeriesNumber"] == series_index_str =', (result["SeriesNumber"] == series_index_str))
-                            debug_print('_update_metadata: not (result["Series"] == newmi.series or result["SeriesNumber"] == series_index_str) =', not (result["Series"] == newmi.series or result["SeriesNumber"] == series_index_str))
-                            if  not (result["Series"] == newmi.series and (result["SeriesNumber"] == newmi.series_index_string or result["SeriesNumber"] == series_index_str)):
+                            debug_print('_update_metadata: not (result["Series"] == newmi.series and ((newmi.series_index_string is not None and result["SeriesNumber"] == newmi.series_index_string) or result["SeriesNumber"] == series_index_str)) =', not (result["Series"] == newmi.series and ((newmi.series_index_string is not None and result["SeriesNumber"] == newmi.series_index_string) or result["SeriesNumber"] == series_index_str)))
+                            if not (result["Series"] == newmi.series and ((newmi.series_index_string is not None and result["SeriesNumber"] == newmi.series_index_string) or result["SeriesNumber"] == series_index_str)):
                                 debug_print("_update_metadata: setting series")
                                 set_clause_columns.append('Series=?')
                                 set_clause_columns.append('SeriesNumber=?')
Basically, on affected books (i.e., all those sent before SeriesID handling), Series was set, SeriesID was set, SeriesNumberFloat was set, but SeriesNumber was None.

I'm not *quite* sure where the newmi.series_index_string thingy is supposed to come from, but it was *always* None on my end, which was screwing up the check, as it was matching on SeriesNumber == newmi.series_index_string == None, which feels wrong .

----

Possibly related, in the Device view, the "Manage series information in device library" button implodes with something like that on those:

Code:
Traceback (most recent call last):
  File "calibre_plugins.koboutilities.action", line 1708, in manage_series_on_device
    d = ManageSeriesDeviceDialog(self.gui, self, seriesBooks, all_series, series_columns)
  File "calibre_plugins.koboutilities.dialogs", line 2161, in __init__
    self.series_column_changed()
  File "calibre_plugins.koboutilities.dialogs", line 2311, in series_column_changed
    initial_series_index = int(first_book.series_index())
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
----

And I'm *guessing* the driver itself is responsible for some of this, because it gets screwy again on every new USBMS session for books that were sent before the SeriesID stuff was implemented .

(I obviously have full automatic metadata handling enabled).

----

It's 5AM, so, I may be talking out of my ass. Apologies in advance .

----

EDIT: Okay, apparently, my on-device metadata.calibre file genuinely had stuff with series_index set to null, for some reason, and getting that to change proved an uphill battle. So, I wiped it, it was re-generated, it's now sane; and a couple USBMS sessions later and a forced metadata update via the patched plugin, and things *appear* to be in order now .

Last edited by NiLuJe; 10-19-2020 at 12:33 PM.
NiLuJe is offline   Reply With Quote
Old 10-19-2020, 02:00 AM   #1955
compurandom
Guru
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 920
Karma: 417282
Join Date: Jun 2015
Device: kobo aura h2o, kobo forma
Quote:
Originally Posted by davidfor View Post
I have considered that, but, the problem is defining "further in the book". The percent read isn't enough as it is an integer. Any book longer than 100 pages will mean that you have to turn multiple pages to go up by 1%.
I was afraid it would be messy.
But basing it on percentage might still be useful, because it's pretty rare I'd read less than 1% of a book in a sitting, no matter how many pages it has. And if that does happen, it doesn't hurt that much to miss an update -- pick it up next time.

Maybe base it on the percentage, with the caveat in the tooltip that it may not pick up every update. Or maybe use percentage and update time, but not if percentage is LESS than it was?

Here's a potential scenario. I pick up a device and read a chapter and wander off. Some time later, I pick up the other device by accident and realize it's on the wrong page. Now the more up to date device has an older date but a later position. It now matters which device I sync first -- but if the percentage was being used as a filter, it wouldn't. And even if I sync the devices in the right order, I'll need to make sure I reject the position update on the second device.

What if the book is being reread? Then reset the percentage when starting the reread...

I agree that needing to open the book to check if an automatic update is ok is not really a good idea.
compurandom is offline   Reply With Quote
Advert
Old 10-19-2020, 06:05 AM   #1956
_HaPe_
Junior Member
_HaPe_ began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Oct 2020
Device: Kobo Touch
Thank you very much for this plugin. Being able to synchronize read status is really convenient.

I managed to set up the required columns. Whenever I read a few pages and attach the reader, it asks to update the "Percent read" values in Calibre. This is great. When deleting all books on the reader and re-adding them, I am able to transfer the reading status by selecting all books with "Percent read = 100", pressing the "Update metadata in device library" button and then using the "Change reading status" option.

I can not find an option to transfer the "Last read date" column from Calibre to the device, though. This has the side effect that every time I connect the reader, the plugin wants to delete the "Last read" date from the Calibre library:



Is there a way to transfer the "Last read date" column from Calibre to the reader? I am using Kobo utilities 2.11.8 and Calibre 5.3.0.
_HaPe_ is offline   Reply With Quote
Old 10-20-2020, 12:47 PM   #1957
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,851
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Did you try the "Only if more recent" option in Kobo Utilities Option > Profiles > Store on connect? At least that might prevent it from trying to delete the date.

Last edited by ownedbycats; 10-20-2020 at 11:45 PM.
ownedbycats is online now   Reply With Quote
Old 10-20-2020, 11:14 PM   #1958
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by _HaPe_ View Post
Thank you very much for this plugin. Being able to synchronize read status is really convenient.

I managed to set up the required columns. Whenever I read a few pages and attach the reader, it asks to update the "Percent read" values in Calibre. This is great. When deleting all books on the reader and re-adding them, I am able to transfer the reading status by selecting all books with "Percent read = 100", pressing the "Update metadata in device library" button and then using the "Change reading status" option.

I can not find an option to transfer the "Last read date" column from Calibre to the device, though. This has the side effect that every time I connect the reader, the plugin wants to delete the "Last read" date from the Calibre library:



Is there a way to transfer the "Last read date" column from Calibre to the reader? I am using Kobo utilities 2.11.8 and Calibre 5.3.0.
For the reading status, "Update metadata in device library" is brute force. It sets all the books selected to the same status and date. It doesn't use the stored reading status. That can be restored using the "Store/Restore current bookmark" function. And the default there is to use the last reading timestamp. But, there is an option to use the current date instead.
davidfor is offline   Reply With Quote
Old 10-22-2020, 09:35 AM   #1959
compurandom
Guru
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 920
Karma: 417282
Join Date: Jun 2015
Device: kobo aura h2o, kobo forma
Can I ask another feature? Can I get a way for the backup feature to add .adds and .addons directories in the zip? I keep tweaking settings and then forgetting to back them up.
compurandom is offline   Reply With Quote
Old 10-22-2020, 10:17 PM   #1960
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by compurandom View Post
Can I ask another feature? Can I get a way for the backup feature to add .adds and .addons directories in the zip? I keep tweaking settings and then forgetting to back them up.
The problem is what to backup from those locations. If you did everything, then you get the code and images and anything else that gets put in there. Otherwise, you need to know what the configuration files are. The current backup is picking a list of known files.
davidfor is offline   Reply With Quote
Old 10-23-2020, 08:01 AM   #1961
compurandom
Guru
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 920
Karma: 417282
Join Date: Jun 2015
Device: kobo aura h2o, kobo forma
Quote:
Originally Posted by davidfor View Post
The problem is what to backup from those locations. If you did everything, then you get the code and images and anything else that gets put in there. Otherwise, you need to know what the configuration files are. The current backup is picking a list of known files.
I can see that as a problem, but right now everything in those directories for me is a config file. (I have NickelMenu and miniclock installed.) The actual binaries are in .kobo

Probably adding .adds / .addons is not the best idea, so much as allowing a user configurable list. Would it make sense to bury something like this in preferences -> tweaks? maybe with these two directories as a documentation comment by default?
compurandom is offline   Reply With Quote
Old 10-23-2020, 09:19 AM   #1962
_HaPe_
Junior Member
_HaPe_ began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Oct 2020
Device: Kobo Touch
Quote:
Originally Posted by ownedbycats View Post
Did you try the "Only if more recent" option in Kobo Utilities Option > Profiles > Store on connect? At least that might prevent it from trying to delete the date.
Thanks for the suggestion. I did try that but I think that the option suggested by davidfor is the more "clean" way to do it.

Quote:
Originally Posted by davidfor View Post
For the reading status, "Update metadata in device library" is brute force. It sets all the books selected to the same status and date. It doesn't use the stored reading status. That can be restored using the "Store/Restore current bookmark" function. And the default there is to use the last reading timestamp. But, there is an option to use the current date instead.
That's great davidfor! Thanks a lot . I was looking for exactly that feature (so I don't need to manually select books and mark them with the brute force method).

May I suggest that you rename the option to make it more clear for new users (like me)? To me, the name sounded like it can only be used for the "dog ear" bookmarks, so I did not even try selecting it. I think that "Store/Restore reading status in device library" could be a lot easier to understand. Also, it would be more in line with the related option "Set reading status in device library".

Have you considered uploading the plugin to GitHub? That way, it would be easier for others to contribute. Also, when someone is looking for help, existing independent issues on GitHub are probably a lot easier to browse than a forum thread with thousands of posts. Maybe I can even contribute a few things (like the name change suggested above).
_HaPe_ is offline   Reply With Quote
Old 10-23-2020, 10:35 AM   #1963
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,669
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by davidfor View Post
The problem is what to backup from those locations. If you did everything, then you get the code and images and anything else that gets put in there. Otherwise, you need to know what the configuration files are. The current backup is picking a list of known files.
Maybe add an option to backup all .directories. But separate that and make it manual only.
JSWolf is online now   Reply With Quote
Old 10-24-2020, 01:41 AM   #1964
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Honestly, I'm not very interested in chasing after non-Kobo addons. I don't use any and the plugin is working with the firmware, not against it.
davidfor is offline   Reply With Quote
Old 10-24-2020, 07:52 AM   #1965
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by NiLuJe View Post
@davidfor:

I've had a weird issue since the Series tab was introduced whereas the metadata migration apparently failed to pickup everything properly, so I've essentially ended up with a lot of stuff with a series set, but no index.

The plugin's update on device metadata thingy didn't help, because the check was failing.

This fixes it on my end:

Code:
diff -NuarpZ KU_2.11.8/action.py KU/action.py
--- KU_2.11.8/action.py 2020-10-19 05:35:00.760538753 +0200
+++ KU/action.py        2020-10-19 05:32:18.913540567 +0200
@@ -3773,14 +3773,16 @@ class KoboUtilitiesAction(InterfaceActio
 
                         if self.supports_series and self.options['series']:
                             debug_print("_update_metadata: self.options['series']", self.options['series'])
-                            debug_print("_update_metadata: newmi.series=", newmi.series, "newmi.series_index=", newmi.series_index)
+                            debug_print("_update_metadata: newmi.series=", newmi.series, "newmi.series_index=", newmi.series_index, "newmi.series_index_string=", newmi.series_index_string)
                             debug_print("_update_metadata: result['Series'] ='%s' result['SeriesNumber'] =%s" % (result["Series"], result["SeriesNumber"]))
                             debug_print("_update_metadata: result['SeriesID'] ='%s' result['SeriesNumberFloat'] =%s" % (result["SeriesID"], result["SeriesNumberFloat"]))
                             debug_print("_update_metadata: result['Series'] == newmi.series =", (result["Series"] == newmi.series))
                             series_index_str = ("%g" % newmi.series_index) if newmi.series_index is not None else None
+                            debug_print("_update_metadata: series_index_str=", series_index_str)
+                            debug_print('_update_metadata: (newmi.series_index_string is not None and result["SeriesNumber"] == newmi.series_index_string) =', (newmi.series_index_string is not None and result["SeriesNumber"] == newmi.series_index_string))
                             debug_print('_update_metadata: result["SeriesNumber"] == series_index_str =', (result["SeriesNumber"] == series_index_str))
-                            debug_print('_update_metadata: not (result["Series"] == newmi.series or result["SeriesNumber"] == series_index_str) =', not (result["Series"] == newmi.series or result["SeriesNumber"] == series_index_str))
-                            if  not (result["Series"] == newmi.series and (result["SeriesNumber"] == newmi.series_index_string or result["SeriesNumber"] == series_index_str)):
+                            debug_print('_update_metadata: not (result["Series"] == newmi.series and ((newmi.series_index_string is not None and result["SeriesNumber"] == newmi.series_index_string) or result["SeriesNumber"] == series_index_str)) =', not (result["Series"] == newmi.series and ((newmi.series_index_string is not None and result["SeriesNumber"] == newmi.series_index_string) or result["SeriesNumber"] == series_index_str)))
+                            if not (result["Series"] == newmi.series and ((newmi.series_index_string is not None and result["SeriesNumber"] == newmi.series_index_string) or result["SeriesNumber"] == series_index_str)):
                                 debug_print("_update_metadata: setting series")
                                 set_clause_columns.append('Series=?')
                                 set_clause_columns.append('SeriesNumber=?')
Basically, on affected books (i.e., all those sent before SeriesID handling), Series was set, SeriesID was set, SeriesNumberFloat was set, but SeriesNumber was None.

I'm not *quite* sure where the newmi.series_index_string thingy is supposed to come from, but it was *always* None on my end, which was screwing up the check, as it was matching on SeriesNumber == newmi.series_index_string == None, which feels wrong .

----

Possibly related, in the Device view, the "Manage series information in device library" button implodes with something like that on those:

Code:
Traceback (most recent call last):
  File "calibre_plugins.koboutilities.action", line 1708, in manage_series_on_device
    d = ManageSeriesDeviceDialog(self.gui, self, seriesBooks, all_series, series_columns)
  File "calibre_plugins.koboutilities.dialogs", line 2161, in __init__
    self.series_column_changed()
  File "calibre_plugins.koboutilities.dialogs", line 2311, in series_column_changed
    initial_series_index = int(first_book.series_index())
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
----

And I'm *guessing* the driver itself is responsible for some of this, because it gets screwy again on every new USBMS session for books that were sent before the SeriesID stuff was implemented .

(I obviously have full automatic metadata handling enabled).

----

It's 5AM, so, I may be talking out of my ass. Apologies in advance .

----

EDIT: Okay, apparently, my on-device metadata.calibre file genuinely had stuff with series_index set to null, for some reason, and getting that to change proved an uphill battle. So, I wiped it, it was re-generated, it's now sane; and a couple USBMS sessions later and a forced metadata update via the patched plugin, and things *appear* to be in order now .
Ugh. Both of these are a mix of Python 3 conversion, and some stupid code. The code in the driver for setting the series info also as a problem if the series index on the device is null. I've have fixed it (though not checked it in) and replaced the code in the plugin with it. It works and is a lot more readable.

I have attached a beta that should fix these problems. If you can give it a go and tell me if there are any problems, that would be good.
Attached Files
File Type: zip KoboUtilities-beta.zip (287.2 KB, 185 views)
davidfor is offline   Reply With Quote
Reply

Tags
calibre, kobo, kobo utilities, kobo-utilities, plugins

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Manga plugin mastertea Plugins 6 01-06-2022 02:43 AM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 14 04-04-2021 05:25 AM
Kobo Utilities Plugin Question nikev Kobo Reader 10 09-25-2018 11:55 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 07:39 AM.


MobileRead.com is a privately owned, operated and funded community.