mirror of
https://github.com/ciromattia/kcc
synced 2026-10-05 09:02:32 +00:00
fix file splitting/chunking for real in certain situations (#839)
* fix file splitting without ComicInfo.xml * remove dead var
This commit is contained in:
@@ -657,16 +657,14 @@ def getWorkFolder(afile):
|
|||||||
path = cbx.extract(workdir)
|
path = cbx.extract(workdir)
|
||||||
sanitizePermissions(path)
|
sanitizePermissions(path)
|
||||||
tdir = os.listdir(workdir)
|
tdir = os.listdir(workdir)
|
||||||
is_nested_single_dir = False
|
|
||||||
if len(tdir) == 2 and 'ComicInfo.xml' in tdir:
|
if len(tdir) == 2 and 'ComicInfo.xml' in tdir:
|
||||||
tdir.remove('ComicInfo.xml')
|
tdir.remove('ComicInfo.xml')
|
||||||
is_nested_single_dir = os.path.isdir(os.path.join(workdir, tdir[0]))
|
if os.path.isdir(os.path.join(workdir, tdir[0])):
|
||||||
if is_nested_single_dir:
|
|
||||||
os.replace(
|
os.replace(
|
||||||
os.path.join(workdir, 'ComicInfo.xml'),
|
os.path.join(workdir, 'ComicInfo.xml'),
|
||||||
os.path.join(workdir, tdir[0], 'ComicInfo.xml')
|
os.path.join(workdir, tdir[0], 'ComicInfo.xml')
|
||||||
)
|
)
|
||||||
if len(tdir) == 1 and is_nested_single_dir:
|
if len(tdir) == 1 and os.path.isdir(os.path.join(workdir, tdir[0])):
|
||||||
path = os.path.join(workdir, tdir[0])
|
path = os.path.join(workdir, tdir[0])
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
rmtree(workdir, True)
|
rmtree(workdir, True)
|
||||||
|
|||||||
Reference in New Issue
Block a user