mirror of
https://github.com/ciromattia/kcc
synced 2026-07-23 05:03:13 +00:00
fix: Destination path... already exists (#1404)
This commit is contained in:
@@ -979,9 +979,15 @@ def getWorkFolder(afile, workdir=None):
|
|||||||
os.path.join(fullPath, tdir[0], 'ComicInfo.xml')
|
os.path.join(fullPath, tdir[0], 'ComicInfo.xml')
|
||||||
)
|
)
|
||||||
if len(tdir) == 1 and os.path.isdir(os.path.join(fullPath, tdir[0])):
|
if len(tdir) == 1 and os.path.isdir(os.path.join(fullPath, tdir[0])):
|
||||||
|
if options.tempdir:
|
||||||
|
workdir2 = mkdtemp('', 'KCC-', os.path.dirname(afile))
|
||||||
|
else:
|
||||||
|
workdir2 = mkdtemp('', 'KCC-')
|
||||||
|
fullPath2 = os.path.join(workdir2, 'OEBPS', 'Images')
|
||||||
for file in os.listdir(os.path.join(fullPath, tdir[0])):
|
for file in os.listdir(os.path.join(fullPath, tdir[0])):
|
||||||
move(os.path.join(fullPath, tdir[0], file), fullPath)
|
move(os.path.join(fullPath, tdir[0], file), fullPath2)
|
||||||
os.rmdir(os.path.join(fullPath, tdir[0]))
|
rmtree(workdir, True)
|
||||||
|
return workdir2
|
||||||
|
|
||||||
if options.legacyextract:
|
if options.legacyextract:
|
||||||
return workdir
|
return workdir
|
||||||
|
|||||||
Reference in New Issue
Block a user