This commit is contained in:
Ade
2016-12-11 19:12:29 +13:00
parent 6d40178ce2
commit 82695311c4
2 changed files with 9 additions and 7 deletions

View File

@@ -639,14 +639,15 @@ def preserve_torrent_directory(albumpath):
# Copy to temp dir
subdir = os.path.join(new_folder, "headphones")
logger.info("Copying files to " + subdir.decode(headphones.SYS_ENCODING, 'replace')
+ " subfolder to preserve downloaded files for seeding")
logger.info("Copying files to " + subdir.decode(headphones.SYS_ENCODING,
'replace') + " subfolder to preserve downloaded files for seeding")
# Attempt to stop multiple temp dirs being created for the same albumpath
tempdir = os.path.join(tempdir, prefix)
if len (glob.glob(tempdir + '*/')) >= 3:
logger.error("Looks like a temp subfolder has previously been created for this albumpath, not continuing "
+ tempdir.decode(headphones.SYS_ENCODING, 'replace'))
if len(glob.glob(tempdir + '*/')) >= 3:
logger.error(
"Looks like a temp subfolder has previously been created for this albumpath, not continuing " + tempdir.decode(
headphones.SYS_ENCODING, 'replace'))
return None
try:
@@ -659,7 +660,8 @@ def preserve_torrent_directory(albumpath):
shutil.rmtree(new_folder)
return None
def cue_split(albumpath,keep_original_folder=False):
def cue_split(albumpath, keep_original_folder=False):
"""
Attempts to check and split audio files by a cue for the given directory.
"""

View File

@@ -1266,7 +1266,7 @@ def forcePostProcess(dir=None, expand_subfolders=True, album_dir=None, keep_orig
# Not found from meta data, check if there's a cue to split and try meta data again
kind = None
if headphones.CONFIG.CUE_SPLIT and not name and not album:
cue_folder = helpers.cue_split(folder,keep_original_folder=keep_original_folder)
cue_folder = helpers.cue_split(folder, keep_original_folder=keep_original_folder)
if cue_folder:
try:
name, album, year = helpers.extract_metadata(cue_folder)