mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Various iTunes driver improvements
This commit is contained in:
commit
38851d6ddb
BIN
resources/tracer.epub
Normal file
BIN
resources/tracer.epub
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -260,7 +260,7 @@ class MetaInformation(object):
|
||||
setattr(self, x, getattr(mi, x, None))
|
||||
|
||||
def print_all_attributes(self):
|
||||
for x in ('author', 'author_sort', 'title_sort', 'comments', 'category', 'publisher',
|
||||
for x in ('title','author', 'author_sort', 'title_sort', 'comments', 'category', 'publisher',
|
||||
'series', 'series_index', 'tags', 'rating', 'isbn', 'language',
|
||||
'application_id', 'manifest', 'toc', 'spine', 'guide', 'cover',
|
||||
'book_producer', 'timestamp', 'lccn', 'lcc', 'ddc', 'pubdate',
|
||||
|
@ -182,7 +182,7 @@ def get_metadata(stream, extract_cover=True):
|
||||
def get_quick_metadata(stream):
|
||||
return get_metadata(stream, False)
|
||||
|
||||
def set_metadata(stream, mi, apply_null=False):
|
||||
def set_metadata(stream, mi, apply_null=False, update_timestamp=False):
|
||||
stream.seek(0)
|
||||
reader = OCFZipReader(stream, root=os.getcwdu())
|
||||
mi = MetaInformation(mi)
|
||||
@ -196,6 +196,8 @@ def set_metadata(stream, mi, apply_null=False):
|
||||
reader.opf.tags = []
|
||||
if not getattr(mi, 'isbn', None):
|
||||
reader.opf.isbn = None
|
||||
if update_timestamp and mi.timestamp is not None:
|
||||
reader.opf.timestamp = mi.timestamp
|
||||
|
||||
newopf = StringIO(reader.opf.render())
|
||||
safe_replace(stream, reader.container[OPF.MIMETYPE], newopf)
|
||||
|
@ -788,6 +788,7 @@ class BasicNewsRecipe(Recipe):
|
||||
}
|
||||
|
||||
.summary_byline {
|
||||
text-align:left;
|
||||
font-family:monospace;
|
||||
}
|
||||
|
||||
@ -1139,12 +1140,6 @@ class BasicNewsRecipe(Recipe):
|
||||
mi = MetaInformation(self.short_title() + strftime(self.timefmt), [__appname__])
|
||||
mi.publisher = __appname__
|
||||
mi.author_sort = __appname__
|
||||
if self.output_profile.name == 'iPad':
|
||||
date_as_author = '%s, %s %s, %s' % (strftime('%A'), strftime('%B'), strftime('%d').lstrip('0'), strftime('%Y'))
|
||||
mi = MetaInformation(self.short_title(), [date_as_author])
|
||||
mi.publisher = __appname__
|
||||
sort_author = re.sub('^\s*A\s+|^\s*The\s+|^\s*An\s+', '', self.title).rstrip()
|
||||
mi.author_sort = '%s %s' % (sort_author, strftime('%Y-%m-%d'))
|
||||
mi.publication_type = 'periodical:'+self.publication_type
|
||||
mi.timestamp = nowf()
|
||||
mi.comments = self.description
|
||||
|
Loading…
x
Reference in New Issue
Block a user