only try first image
This commit is contained in:
parent
0f9cbe8332
commit
25b3f26d6b
2 changed files with 10 additions and 15 deletions
|
@ -10,15 +10,12 @@ def cover(path):
|
|||
try:
|
||||
from unrar import rarfile
|
||||
rar = rarfile.RarFile(path)
|
||||
for cover in ox.sorted_strings(rar.namelist()):
|
||||
try:
|
||||
files = rar.namelist()
|
||||
if files:
|
||||
cover = ox.sorted_strings(files)[0]
|
||||
data = rar.read(cover)
|
||||
except:
|
||||
data = None
|
||||
finally:
|
||||
return data
|
||||
except:
|
||||
data = None
|
||||
return data
|
||||
|
||||
def info(path):
|
||||
|
|
|
@ -15,15 +15,13 @@ def cover(path):
|
|||
return data
|
||||
files = [f.filename for f in z.filelist]
|
||||
if files:
|
||||
for cover in ox.sortedstrings(files):
|
||||
cover = ox.sortedstrings(files)[0]
|
||||
try:
|
||||
data = z.read(cover)
|
||||
except:
|
||||
data = None
|
||||
finally:
|
||||
return data
|
||||
|
||||
|
||||
def info(path):
|
||||
data = {}
|
||||
data['title'] = os.path.splitext(os.path.basename(path))[0]
|
||||
|
|
Loading…
Reference in a new issue