mirror of
https://github.com/ciromattia/kcc
synced 2026-07-22 20:53: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')
|
||||
)
|
||||
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])):
|
||||
move(os.path.join(fullPath, tdir[0], file), fullPath)
|
||||
os.rmdir(os.path.join(fullPath, tdir[0]))
|
||||
move(os.path.join(fullPath, tdir[0], file), fullPath2)
|
||||
rmtree(workdir, True)
|
||||
return workdir2
|
||||
|
||||
if options.legacyextract:
|
||||
return workdir
|
||||
|
||||
Reference in New Issue
Block a user