mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Use the correct metadata backup implementation
This commit is contained in:
parent
d0b826c39a
commit
934d4ba258
@ -136,8 +136,7 @@ Various things that require other things before they can be migrated:
|
|||||||
columns/categories/searches info into
|
columns/categories/searches info into
|
||||||
self.field_metadata.
|
self.field_metadata.
|
||||||
2. Port library/restore.py
|
2. Port library/restore.py
|
||||||
3. Replace the metadatabackup thread with the new implementation when using the new backend.
|
3. Check that content server reloading on metadata,db change, metadata
|
||||||
4. Check that content server reloading on metadata,db change, metadata
|
|
||||||
backup, refresh gui on calibredb add and moving libraries all work (check
|
backup, refresh gui on calibredb add and moving libraries all work (check
|
||||||
them on windows as well for file locking issues)
|
them on windows as well for file locking issues)
|
||||||
'''
|
'''
|
||||||
|
@ -21,7 +21,7 @@ from calibre.utils.date import dt_factory, qt_to_dt, as_local_time
|
|||||||
from calibre.utils.icu import sort_key
|
from calibre.utils.icu import sort_key
|
||||||
from calibre.utils.search_query_parser import SearchQueryParser
|
from calibre.utils.search_query_parser import SearchQueryParser
|
||||||
from calibre.db.search import _match, CONTAINS_MATCH, EQUALS_MATCH, REGEXP_MATCH
|
from calibre.db.search import _match, CONTAINS_MATCH, EQUALS_MATCH, REGEXP_MATCH
|
||||||
from calibre.library.caches import (MetadataBackup, force_to_bool)
|
from calibre.library.caches import force_to_bool
|
||||||
from calibre.library.save_to_disk import find_plugboard
|
from calibre.library.save_to_disk import find_plugboard
|
||||||
from calibre import strftime, isbytestring
|
from calibre import strftime, isbytestring
|
||||||
from calibre.constants import filesystem_encoding, DEBUG, config_dir
|
from calibre.constants import filesystem_encoding, DEBUG, config_dir
|
||||||
@ -234,6 +234,10 @@ class BooksModel(QAbstractTableModel): # {{{
|
|||||||
self.start_metadata_backup()
|
self.start_metadata_backup()
|
||||||
|
|
||||||
def start_metadata_backup(self):
|
def start_metadata_backup(self):
|
||||||
|
if hasattr(self.db, 'new_api'):
|
||||||
|
from calibre.db.backup import MetadataBackup
|
||||||
|
else:
|
||||||
|
from calibre.library.caches import MetadataBackup
|
||||||
self.metadata_backup = MetadataBackup(self.db)
|
self.metadata_backup = MetadataBackup(self.db)
|
||||||
self.metadata_backup.start()
|
self.metadata_backup.start()
|
||||||
|
|
||||||
@ -1209,7 +1213,6 @@ class DeviceBooksModel(BooksModel): # {{{
|
|||||||
self.book_in_library = None
|
self.book_in_library = None
|
||||||
self.sync_icon = QIcon(I('sync.png'))
|
self.sync_icon = QIcon(I('sync.png'))
|
||||||
|
|
||||||
|
|
||||||
def counts(self):
|
def counts(self):
|
||||||
return Counts(len(self.db), len(self.db), len(self.map))
|
return Counts(len(self.db), len(self.db), len(self.map))
|
||||||
|
|
||||||
@ -1613,3 +1616,4 @@ class DeviceBooksModel(BooksModel): # {{{
|
|||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user