mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
ignore empty folders but don't delete. Fixes #532
This commit is contained in:
parent
d7cfec90e7
commit
2a178a80aa
1 changed files with 2 additions and 2 deletions
|
@ -568,13 +568,13 @@ def getDirs(section, subsection, link = 'hard'):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Failed to move %s to its own directory: %s" % (os.path.split(mediafile)[1], e))
|
logger.error("Failed to move %s to its own directory: %s" % (os.path.split(mediafile)[1], e))
|
||||||
|
|
||||||
removeEmptyFolders(path, removeRoot=False)
|
#removeEmptyFolders(path, removeRoot=False)
|
||||||
|
|
||||||
if os.listdir(path):
|
if os.listdir(path):
|
||||||
for dir in [os.path.join(path, o) for o in os.listdir(path) if
|
for dir in [os.path.join(path, o) for o in os.listdir(path) if
|
||||||
os.path.isdir(os.path.join(path, o))]:
|
os.path.isdir(os.path.join(path, o))]:
|
||||||
sync = [ o for o in os.listdir(dir) if os.path.splitext(o)[1] == '.!sync' ]
|
sync = [ o for o in os.listdir(dir) if os.path.splitext(o)[1] == '.!sync' ]
|
||||||
if len(sync) > 0:
|
if len(sync) > 0 or len(os.listdir(dir)) == 0:
|
||||||
continue
|
continue
|
||||||
folders.extend([dir])
|
folders.extend([dir])
|
||||||
return folders
|
return folders
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue