Make use filename metadata only apply only to manually added books, not recipes

This commit is contained in:
Starson17 2010-02-01 11:55:29 -05:00
parent 09fb99ab7e
commit b5fb7d6c42

View File

@ -84,11 +84,10 @@ def get_metadata(stream, stream_type='lrf', use_libprs_metadata=False):
return opf return opf
mi = MetaInformation(None, None) mi = MetaInformation(None, None)
if prefs['read_file_metadata']:
mi = get_file_type_metadata(stream, stream_type)
name = os.path.basename(getattr(stream, 'name', '')) name = os.path.basename(getattr(stream, 'name', ''))
base = metadata_from_filename(name) base = metadata_from_filename(name)
if ((name.find('calibre') != -1 and name.find('recipe') != -1) or prefs['read_file_metadata']):
mi = get_file_type_metadata(stream, stream_type)
if base.title == os.path.splitext(name)[0] and base.authors is None: if base.title == os.path.splitext(name)[0] and base.authors is None:
# Assume that there was no metadata in the file and the user set pattern # Assume that there was no metadata in the file and the user set pattern
# to match meta info from the file name did not match. # to match meta info from the file name did not match.