View Single Post
Old 11-28-2020, 11:32 AM   #2008
BradleyDS2
Junior Member
BradleyDS2 began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2020
Device: Kobo Clara HD
Quote:
Originally Posted by davidfor View Post
@BradleyDS2: Ok, I can see what is happening. And the fact you are running this manually and not in the background as a job is the explanation. That is different code and I rarely use it.

The attached beta should fix this. I've rewritten the code based to more closely match that used for the batch fetch of the reading locations. That should also make it a little faster.

Please test and tell me how it goes. If there are any errors, I will probably need a debug log to look at.
Thank you. Sadly this doesn't seem to work. No errors if "Run in background" is checked.

Here's the debug log for when it's unchecked.

Code:
DEBUG:   17.6 KoboUtilities:get_device - self.device_path="D:\"
DEBUG:   17.6 KoboUtilities:get_device - drive_info: {'main': {'last_library_uuid': None, 'date_last_connected': '2020-11-28T16:29:25.248655+00:00', 'prefix': 'D:/', 'calibre_version': '5.6.0', 'device_store_uuid': 'ad03c71c-5ea5-4153-9ace-69231285914b', 'location_code': 'main', 'device_name': 'Kobo Clara HD'}}
DEBUG:   17.6 migrate_library_config_if_required - start
DEBUG:   17.6 get_library_config - library_config: {'SchemaVersion': 0.1, 'profiles': {'Default': {'customColumnOptions': {'currentReadingLocationColumn': '#pagesreadv3', 'lastReadColumn': '#lastread', 'percentReadColumn': '#pagesreadv2', 'ratingColumn': 'rating'}, 'forDevice': 'ad03c71c-5ea5-4153-9ace-69231285914b', 'profileName': 'Default', 'storeOptionsStore': {'storeOnConnect': False, 'promptToStore': False, 'storeIfMoreRecent': True, 'doNotStoreIfReopened': False}, 'updateOptionsStore': {'doEarlyFirmwareUpdate': False, 'doFirmwareUpdateCheck': False, 'firmwareUpdateCheckLastTime': 0}}}}
DEBUG:   17.6 get_prefs - start - store_name='storeOptionsStore'
DEBUG:   17.6 get_plugin_pref - start - store_name='commonOptionsStore', option='individualDeviceOptions'
DEBUG:   17.6 get_prefs - start - store_name='backupOptionsStore'
DEBUG:   17.6 get_prefs - start - store_name='updateOptionsStore'
DEBUG:   17.6 BEGIN Get Device Path
DEBUG:   17.6 Root path of device: D:\
DEBUG:   17.6 END Get Device Path
DEBUG:   17.6 KoboUtilities::_get_fetch_query_for_firmware_version - using fetch_queries: {'epub': 'SELECT c1.ChapterIDBookmarked, c1.adobe_location, c1.ReadStatus, c1.___PercentRead, c1.Attribution, c1.DateLastRead, c1.Title, c1.MimeType, r.rating, c1.contentId FROM content c1 LEFT OUTER JOIN ratings r ON c1.ContentID = r.ContentID WHERE c1.ContentID = ?', 'kepub': 'SELECT c1.ChapterIDBookmarked, c1.adobe_location, c1.ReadStatus, c1.___PercentRead, c1.Attribution, c1.DateLastRead, c1.Title, c1.MimeType, r.rating, c1.contentId FROM content c1 LEFT OUTER JOIN ratings r ON c1.ContentID = r.ContentID WHERE c1.ContentID = ?'}
DEBUG:   17.6 store_current_bookmark - self.options: {'storeBookmarks': True, 'readingStatus': True, 'setDateToNow': False, 'rating': True, 'clearIfUnread': False, 'storeIfMoreRecent': True, 'doNotStoreIfReopened': True, 'backgroundJob': False, 'profileName': 'Default', 'device_database_path': 'D:\\.kobo\\KoboReader.sqlite', 'job_function': 'store_current_bookmark', 'supports_ratings': True, 'fetch_queries': {'epub': 'SELECT c1.ChapterIDBookmarked, c1.adobe_location, c1.ReadStatus, c1.___PercentRead, c1.Attribution, c1.DateLastRead, c1.Title, c1.MimeType, r.rating, c1.contentId FROM content c1 LEFT OUTER JOIN ratings r ON c1.ContentID = r.ContentID WHERE c1.ContentID = ?', 'kepub': 'SELECT c1.ChapterIDBookmarked, c1.adobe_location, c1.ReadStatus, c1.___PercentRead, c1.Attribution, c1.DateLastRead, c1.Title, c1.MimeType, r.rating, c1.contentId FROM content c1 LEFT OUTER JOIN ratings r ON c1.ContentID = r.ContentID WHERE c1.ContentID = ?'}, 'allOnDevice': False, 'promptToStore': True}
DEBUG:   17.6 _get_selected_ids - self.gui.current_view().model() <calibre.gui2.library.models.BooksModel object at 0x0000021DB0B12430>
DEBUG:   17.6 store_current_bookmark - selectedIDs: [449]
DEBUG:   17.6 _store_current_bookmark - profileName= Default
DEBUG:   17.6 migrate_library_config_if_required - start
DEBUG:   17.6 get_library_config - library_config: {'SchemaVersion': 0.1, 'profiles': {'Default': {'customColumnOptions': {'currentReadingLocationColumn': '#pagesreadv3', 'lastReadColumn': '#lastread', 'percentReadColumn': '#pagesreadv2', 'ratingColumn': 'rating'}, 'forDevice': 'ad03c71c-5ea5-4153-9ace-69231285914b', 'profileName': 'Default', 'storeOptionsStore': {'storeOnConnect': False, 'promptToStore': False, 'storeIfMoreRecent': True, 'doNotStoreIfReopened': False}, 'updateOptionsStore': {'doEarlyFirmwareUpdate': False, 'doFirmwareUpdateCheck': False, 'firmwareUpdateCheckLastTime': 0}}}}
DEBUG:   17.6 get_column_names - columns_config: {'currentReadingLocationColumn': '#pagesreadv3', 'lastReadColumn': '#lastread', 'percentReadColumn': '#pagesreadv2', 'ratingColumn': 'rating'}
DEBUG:   17.6 _store_current_bookmark - kobo_chapteridbookmarked_column_name= #pagesreadv3
DEBUG:   17.6 _store_current_bookmark - kobo_percentRead_column_name= #pagesreadv2
DEBUG:   17.6 _store_current_bookmark - rating_column_name= rating
DEBUG:   17.6 _store_current_bookmark - last_read_column_name= #lastread
DEBUG:   17.6 _store_current_bookmark - kobo_chapteridbookmarked_column_name= #pagesreadv3
DEBUG:   17.6 _store_current_bookmark - kobo_chapteridbookmarked_col_label= pagesreadv3
DEBUG:   17.6 _store_current_bookmark - kobo_percentRead_col_label= pagesreadv2
DEBUG:   17.6 _store_current_bookmark - rating_col_label= None
DEBUG:   17.6 _store_current_bookmark - last_read_col_label= lastread
DEBUG:   17.6 _store_current_bookmark - Starting to look at selected books...
DEBUG:   17.6 _store_current_bookmark - Looking at book: By the Grace of the Gods: Volume 5
DEBUG:   17.6 _store_current_bookmark - contentId='file:///mnt/onboard/By the Grace of the Gods/By the Grace of the Gods_ Volume 5 - Roy.kepub.epub'
DEBUG:   17.6 KoboUtilities::_get_fetch_query_for_firmware_version - using fetch_queries: {'epub': 'SELECT c1.ChapterIDBookmarked, c1.adobe_location, c1.ReadStatus, c1.___PercentRead, c1.Attribution, c1.DateLastRead, c1.Title, c1.MimeType, r.rating, c1.contentId FROM content c1 LEFT OUTER JOIN ratings r ON c1.ContentID = r.ContentID WHERE c1.ContentID = ?', 'kepub': 'SELECT c1.ChapterIDBookmarked, c1.adobe_location, c1.ReadStatus, c1.___PercentRead, c1.Attribution, c1.DateLastRead, c1.Title, c1.MimeType, r.rating, c1.contentId FROM content c1 LEFT OUTER JOIN ratings r ON c1.ContentID = r.ContentID WHERE c1.ContentID = ?'}Traceback (most recent call last):
  File "calibre\customize\ui.py", line 703, in initialize_plugins
  File "calibre\customize\ui.py", line 61, in load_plugin
  File "calibre\customize\zipplugin.py", line 293, in load
  File "importlib\__init__.py", line 127, in import_module
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "calibre\customize\zipplugin.py", line 185, in exec_module
  File "calibre\customize\zipplugin.py", line 181, in get_code
  File "calibre_plugins.dedrm.__init__", line 165
    print u"{0} v{1}: Copying needed library files from plugin's zip".format(PLUGIN_NAME, PLUGIN_VERSION)
          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "calibre\gui2\ui.py", line 134, in __init__
  File "calibre\gui2\ui.py", line 152, in init_iaction
  File "calibre\customize\__init__.py", line 614, in load_actual_plugin
  File "importlib\__init__.py", line 127, in import_module
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "calibre\customize\zipplugin.py", line 192, in exec_module
  File "calibre_plugins.obok_dedrm.action", line 24, in <module>
  File "calibre\customize\zipplugin.py", line 192, in exec_module
  File "calibre_plugins.obok_dedrm.dialogs", line 30, in <module>
  File "calibre\customize\zipplugin.py", line 192, in exec_module
  File "calibre_plugins.obok_dedrm.utilities", line 10, in <module>
ModuleNotFoundError: No module named 'StringIO'
calibre 5.6 [64bit]  embedded-python: True is64bit: True
Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: Count Pages (1, 11, 0) && Kindle hi-res covers (0, 5, 0) && Kobo Books (1, 8, 0) && Kobo Utilities (2, 11, 12) && KoboTouchExtended (3, 4, 1) && Obok DeDRM (6, 5, 4) && Quality Check (1, 10, 1)
Traceback (most recent call last):
  File "calibre_plugins.koboutilities.action", line 987, in handle_bookmarks
  File "calibre_plugins.koboutilities.action", line 1203, in store_current_bookmark
  File "calibre_plugins.koboutilities.action", line 4181, in _store_current_bookmark
TypeError: '>=' not supported between instances of 'NoneType' and 'int'


DEBUG:   17.6 _store_current_bookmark - fetch_query='SELECT c1.ChapterIDBookmarked, c1.adobe_location, c1.ReadStatus, c1.___PercentRead, c1.Attribution, c1.DateLastRead, c1.Title, c1.MimeType, r.rating, c1.contentId FROM content c1 LEFT OUTER JOIN ratings r ON c1.ContentID = r.ContentID WHERE c1.ContentID = ?'
DEBUG:   17.6 _store_current_bookmark - result= {'ChapterIDBookmarked': 'OEBPS/Text/bonus.xhtml#kobo.39.1', 'adobe_location': None, 'ReadStatus': 1, '___PercentRead': 99, 'Attribution': 'Roy', 'DateLastRead': '2020-11-26T11:07:24Z', 'Title': 'By the Grace of the Gods: Volume 5', 'MimeType': 'application/x-kobo-epub+zip', 'Rating': None, 'ContentID': 'file:///mnt/onboard/By the Grace of the Gods/By the Grace of the Gods_ Volume 5 - Roy.kepub.epub'}
DEBUG:   17.6 _store_current_bookmark - result['DateLastRead']= 2020-11-26T11:07:24Z
DEBUG:   17.6 _store_current_bookmark - last_read= 2020-11-26 11:07:24+00:00
DEBUG:   17.6 _store_current_bookmark - book.get_user_metadata(last_read_column_name, True)['#value#']= None
DEBUG:   17.6 _store_current_bookmark - setting mi.last_read= 2020-11-26 11:07:24+00:00
DEBUG:   17.6 _store_current_bookmark - do_not_store_if_reopened - current_percentRead= None

Last edited by BradleyDS2; 11-28-2020 at 11:35 AM.
BradleyDS2 is offline