mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
1) take db.clean out of metadata_single.py
2) add db.clean to shutdown func 3) add db.clean to 2 cli funcs that can delete an author 4) add db.ondevice() to return the ondevice string
This commit is contained in:
parent
8a027ac60c
commit
28f62fd4dd
@ -760,7 +760,6 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
|
||||
_('Could not open %s. Is it being used by another'
|
||||
' program?')%fname, show=True)
|
||||
raise
|
||||
self.db.clean()
|
||||
self.save_state()
|
||||
QDialog.accept(self)
|
||||
if callable(self.accepted_callback):
|
||||
|
@ -522,6 +522,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, # {{{
|
||||
|
||||
|
||||
def shutdown(self, write_settings=True):
|
||||
self.db.clean()
|
||||
for action in self.iactions.values():
|
||||
if not action.shutting_down():
|
||||
return
|
||||
|
@ -324,6 +324,7 @@ def do_remove(db, ids):
|
||||
db.delete_book(y)
|
||||
|
||||
send_message()
|
||||
db.clean()
|
||||
|
||||
def remove_option_parser():
|
||||
return get_parser(_(
|
||||
@ -449,6 +450,7 @@ def command_show_metadata(args, dbpath):
|
||||
def do_set_metadata(db, id, stream):
|
||||
mi = OPF(stream)
|
||||
db.set_metadata(id, mi)
|
||||
db.clean()
|
||||
do_show_metadata(db, id, False)
|
||||
send_message()
|
||||
|
||||
|
@ -332,7 +332,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
||||
|
||||
for prop in ('author_sort', 'authors', 'comment', 'comments', 'isbn',
|
||||
'publisher', 'rating', 'series', 'series_index', 'tags',
|
||||
'title', 'timestamp', 'uuid', 'pubdate'):
|
||||
'title', 'timestamp', 'uuid', 'pubdate', 'ondevice'):
|
||||
setattr(self, prop, functools.partial(get_property,
|
||||
loc=self.FIELD_MAP['comments' if prop == 'comment' else prop]))
|
||||
setattr(self, 'title_sort', functools.partial(get_property,
|
||||
|
Loading…
x
Reference in New Issue
Block a user