Content server: Mobile page breaks if library contains empty books. Now fixed.

This commit is contained in:
Kovid Goyal 2010-01-24 11:25:05 -07:00
parent 3a6fb23646
commit 6b59d8aa96
2 changed files with 4 additions and 1 deletions

View File

@ -1410,7 +1410,6 @@ class EPUB_MOBI(CatalogPlugin):
else:
#if verbose: print "generating new thumbnail for %s" % title['title']
self.generateThumbnail(title, image_dir, thumb_file)
else:
# Use default cover
if self.verbose: print "no cover available for %s, will use default" % \

View File

@ -714,6 +714,10 @@ class LibraryServer(object):
book, books = MarkupTemplate(self.MOBILE_BOOK), []
for record in items[(start-1):(start-1)+num]:
if record[13] is None:
record[13] = ''
if record[6] is None:
record[6] = 0
aus = record[2] if record[2] else __builtin__._('Unknown')
authors = '|'.join([i.replace('|', ',') for i in aus.split(',')])
record[10] = fmt_sidx(float(record[10]))