def preserve_torrent_directory(albumpath):
 from headphones import logger
 new_folder = os.path.join(albumpath, 'headphones-modified'.encode(headphones.SYS_ENCODING, 'replace'))
 logger.info("Copying files to 'headphones-modified' subfolder to preserve downloaded files for seeding")
 try:
  shutil.copytree(albumpath, new_folder)
  return new_folder
 except Exception as e:
  logger.warn(((('Cannot copy/move files to temp folder: ' + new_folder.decode(headphones.SYS_ENCODING, 'replace')) + '. Not continuing. Error: ') + str(e)))
  return None

def preserve_torrent_directory ( albumpath ) : from headphones import logger new_folder = os . path . join ( albumpath , 'headphones-modified' . encode ( headphones . SYS_ENCODING , 'replace' ) ) logger . info ( "Copying files to 'headphones-modified' subfolder to preserve downloaded files for seeding" ) try : shutil . copytree ( albumpath , new_folder ) return new_folder except Exception as e : logger . warn ( ( ( ( 'Cannot copy/move files to temp folder: ' + new_folder . decode ( headphones . SYS_ENCODING , 'replace' ) ) + '. Not continuing. Error: ' ) + str ( e ) ) ) return None
copy torrent directory to headphones-modified to keep files for seeding .