mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix date column not showing date added when adding zip/rar files that contain an OPF with a calibre timestamp in its metadata
This commit is contained in:
parent
19d0de0059
commit
b85d677a1b
@ -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')
|
||||
|
||||
|
||||
|
@ -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')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user