mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Possible fix for problems reading LRF file metadata on OSX in the GUI
This commit is contained in:
parent
aa0c031886
commit
44c7b6af37
@ -61,7 +61,8 @@ class LibraryDatabase(object):
|
||||
title, size, cover = os.path.basename(_file), \
|
||||
os.stat(_file)[ST_SIZE], None
|
||||
ext = title[title.rfind(".")+1:].lower() if title.find(".") > -1 else None
|
||||
mi = get_metadata(open(_file, "r+b"), ext)
|
||||
f = open(_file, "r+b")
|
||||
mi = get_metadata(f, ext)
|
||||
tags = []
|
||||
if not mi.title:
|
||||
mi.title = title
|
||||
@ -73,7 +74,9 @@ class LibraryDatabase(object):
|
||||
tags = ', '.join(tags)
|
||||
else:
|
||||
tags = None
|
||||
data = open(_file).read()
|
||||
f.seek(0)
|
||||
data = f.read()
|
||||
f.close()
|
||||
usize = len(data)
|
||||
data = compress(data)
|
||||
csize = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user