mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
GwR catalog comments
This commit is contained in:
parent
7d69048a4b
commit
1dbbd470a0
@ -3404,6 +3404,19 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
tag_list.append(tag)
|
tag_list.append(tag)
|
||||||
return tag_list
|
return tag_list
|
||||||
|
|
||||||
|
def updateCatalogMetadata(self, comments):
|
||||||
|
''' Store comments to library entry's comments metadata '''
|
||||||
|
self.db.search('title:"%s" author:calibre' % self.title)
|
||||||
|
data = self.db.get_data_as_dict()
|
||||||
|
if data:
|
||||||
|
catalog_id = data[0]['id']
|
||||||
|
cm = self.db.get_metadata(catalog_id, index_is_id=True)
|
||||||
|
cm.comments = comments
|
||||||
|
self.db.set_metadata(catalog_id, cm)
|
||||||
|
else:
|
||||||
|
self.opts.log(u"updateCatalogMetadata(): No library entry found for catalog '%s'" % self.title)
|
||||||
|
return
|
||||||
|
|
||||||
def updateProgressFullStep(self, description):
|
def updateProgressFullStep(self, description):
|
||||||
self.currentStep += 1
|
self.currentStep += 1
|
||||||
self.progressString = description
|
self.progressString = description
|
||||||
@ -3516,6 +3529,9 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
recommendations = []
|
recommendations = []
|
||||||
# recommendations.append(('cover', I('catalog.svg'), OptionRecommendation.HIGH))
|
# recommendations.append(('cover', I('catalog.svg'), OptionRecommendation.HIGH))
|
||||||
|
|
||||||
|
recommendations.append(('comments', 'I added this comment in library.cli:run()',
|
||||||
|
OptionRecommendation.HIGH))
|
||||||
|
|
||||||
dp = getattr(opts, 'debug_pipeline', None)
|
dp = getattr(opts, 'debug_pipeline', None)
|
||||||
if dp is not None:
|
if dp is not None:
|
||||||
recommendations.append(('debug_pipeline', dp,
|
recommendations.append(('debug_pipeline', dp,
|
||||||
@ -3537,6 +3553,7 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
plumber.merge_ui_recommendations(recommendations)
|
plumber.merge_ui_recommendations(recommendations)
|
||||||
|
|
||||||
plumber.run()
|
plumber.run()
|
||||||
|
catalog.updateCatalogMetadata("I added this comment from library.catalog:run()")
|
||||||
return 0
|
return 0
|
||||||
else:
|
else:
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user