Fix #1625 (Only imports one author from Mobipocket (.prc) files)

This commit is contained in:
Kovid Goyal 2009-01-15 19:39:20 -08:00
parent bdc21e2025
commit 4eb4ba3e91
2 changed files with 5 additions and 3 deletions

View File

@ -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'

View File

@ -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: