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