diff --git a/src/calibre/ebooks/metadata/rar.py b/src/calibre/ebooks/metadata/rar.py index 28cb092cbc..39f43ca2bd 100644 --- a/src/calibre/ebooks/metadata/rar.py +++ b/src/calibre/ebooks/metadata/rar.py @@ -29,7 +29,9 @@ def get_metadata(stream): name, data = extract_member(stream, match=None, name=f) stream = BytesIO(data) stream.name = os.path.basename(name) - return get_metadata(stream, stream_type) + mi = get_metadata(stream, stream_type) + mi.timestamp = None + return mi raise ValueError('No ebook found in RAR archive') diff --git a/src/calibre/ebooks/metadata/zip.py b/src/calibre/ebooks/metadata/zip.py index 7369d2055c..4a7926339d 100644 --- a/src/calibre/ebooks/metadata/zip.py +++ b/src/calibre/ebooks/metadata/zip.py @@ -28,14 +28,16 @@ def get_metadata(stream): with CurrentDir(tdir): path = zf.extract(f) mi = get_metadata(open(path,'rb'), stream_type) - if stream_type == 'opf' and mi.application_id == None: + if stream_type == 'opf' and mi.application_id is None: try: # zip archive opf files without an application_id were assumed not to have a cover # reparse the opf and if cover exists read its data from zip archive for the metadata nmi = zip_opf_metadata(path, zf) + nmi.timestamp = None return nmi except: pass + mi.timestamp = None return mi raise ValueError('No ebook found in ZIP archive')