mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Cover Browser: Fix setting an empty template for the title causes an error
This commit is contained in:
parent
431ee00643
commit
1fc681b5d6
@ -94,6 +94,7 @@ if pictureflow is not None:
|
||||
self.template_error_reported = False
|
||||
self.template = db.pref('cover_browser_title_template', '{title}')
|
||||
self.template_is_title = self.template == '{title}'
|
||||
self.template_is_empty = not self.template.strip()
|
||||
|
||||
def count(self):
|
||||
return self.model.count()
|
||||
@ -113,6 +114,8 @@ if pictureflow is not None:
|
||||
self.init_template(db)
|
||||
if self.template_is_title:
|
||||
ans = self.model.title(index)
|
||||
elif self.template_is_empty:
|
||||
ans = ''
|
||||
else:
|
||||
try:
|
||||
ans = self.render_template(self.template, index, db)
|
||||
|
Loading…
x
Reference in New Issue
Block a user