Logo Search packages:      
Sourcecode: calibre version File versions  Download package

def calibre::library::database2::LibraryDatabase2::set_metadata (   self,

Set metadata for the book `id` from the `MetaInformation` object `mi`

Definition at line 1054 of file database2.py.

01054                                   :
        Set metadata for the book `id` from the `MetaInformation` object `mi`
        if mi.title:
            self.set_title(id, mi.title)
        if not mi.authors:
                mi.authors = [_('Unknown')]
        authors = []
        for a in mi.authors:
            authors += string_to_authors(a)
        self.set_authors(id, authors, notify=False)
        if mi.author_sort:
            self.set_author_sort(id, mi.author_sort, notify=False)
        if mi.publisher:
            self.set_publisher(id, mi.publisher, notify=False)
        if mi.rating:
            self.set_rating(id, mi.rating, notify=False)
        if mi.series:
            self.set_series(id, mi.series, notify=False)
        if mi.cover_data[1] is not None:
            self.set_cover(id, mi.cover_data[1])
        elif mi.cover is not None and os.access(mi.cover, os.R_OK):
            self.set_cover(id, open(mi.cover, 'rb').read())
        if mi.tags:
            self.set_tags(id, mi.tags, notify=False)
        if mi.comments:
            self.set_comment(id, mi.comments, notify=False)
        if mi.isbn and mi.isbn.strip():
            self.set_isbn(id, mi.isbn, notify=False)
        if mi.series_index:
            self.set_series_index(id, mi.series_index, notify=False)
        if mi.pubdate:
            self.set_pubdate(id, mi.pubdate, notify=False)
        if getattr(mi, 'timestamp', None) is not None:
            self.set_timestamp(id, mi.timestamp, notify=False)
        self.set_path(id, True)
        self.notify('metadata', [id])

    def set_authors(self, id, authors, notify=True):

Generated by  Doxygen 1.6.0   Back to index