mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1625 (Only imports one author from Mobipocket (.prc) files)
This commit is contained in:
parent
bdc21e2025
commit
4eb4ba3e91
@ -249,7 +249,7 @@ class MetaInformation(object):
|
||||
ans = u''
|
||||
ans += u'Title : ' + unicode(self.title) + u'\n'
|
||||
if self.authors:
|
||||
ans += u'Author : ' + (', '.join(self.authors) if self.authors is not None else u'None')
|
||||
ans += u'Author : ' + (' & '.join(self.authors) if self.authors is not None else _('Unknown'))
|
||||
ans += ((' [' + self.author_sort + ']') if self.author_sort else '') + u'\n'
|
||||
if self.publisher:
|
||||
ans += u'Publisher: '+ unicode(self.publisher) + u'\n'
|
||||
|
@ -33,7 +33,7 @@ class EXTHHeader(object):
|
||||
self.length, self.num_items = struct.unpack('>LL', raw[4:12])
|
||||
raw = raw[12:]
|
||||
pos = 0
|
||||
self.mi = MetaInformation('Unknown', ['Unknown'])
|
||||
self.mi = MetaInformation(_('Unknown'), [_('Unknown')])
|
||||
self.has_fake_cover = True
|
||||
|
||||
for i in range(self.num_items):
|
||||
@ -63,7 +63,9 @@ class EXTHHeader(object):
|
||||
|
||||
def process_metadata(self, id, content, codec):
|
||||
if id == 100:
|
||||
self.mi.authors = [content.decode(codec, 'ignore').strip()]
|
||||
if self.mi.authors == [_('Unknown')]:
|
||||
self.mi.authors = []
|
||||
self.mi.authors.append(content.decode(codec, 'ignore').strip())
|
||||
elif id == 101:
|
||||
self.mi.publisher = content.decode(codec, 'ignore').strip()
|
||||
elif id == 103:
|
||||
|
Loading…
x
Reference in New Issue
Block a user