Fix bug that would raise an exception when failing to read cover information from a LIT file

This commit is contained in:
Kovid Goyal 2008-02-09 16:39:54 +00:00
parent 4bcec54057
commit 70ee94c9b8

View File

@ -745,8 +745,7 @@ def get_metadata(stream):
else:
ext = ext.lower()
cd = litfile.read_image(cover_item)
if cd:
mi.cover_data = (ext, cd)
mi.cover_data = (ext, cd) if cd else (None, None)
except:
title = stream.name if hasattr(stream, 'name') and stream.name else 'Unknown'
mi = MetaInformation(title, ['Unknown'])