def db_meta_pull(): metadata = Metadata() db = Db() calibreid = db.get_id(metadata.id) if calibreid is None: return 1, 'Book not found in Calibre: %s' % options.dir # save metadata from Calibre to metadata.opf c = Calibre() c.write_metadata_file(calibreid, metadata.xmlfilename) # reload metadata from metadata.opf metadata = Metadata() metadata.write_to_book() # push book file with new metadata to Calibre c.update_content(calibreid, metadata.bookfile) return 0, "Finished updating content and metadata file from Calibre's metadata for %s." % options.dir
def writemeta(): metadata = Metadata() metadata.write_to_book() return 0, 'Finished writing metadata from book file in %s.' % options.dir