mirror of https://github.com/evilhero/mylar
Merge c8591757f1
into 201d86ba4d
This commit is contained in:
commit
446b2c5742
|
@ -557,6 +557,7 @@ def rename_param(comicid, comicname, issue, ofilename, comicyear=None, issueid=N
|
|||
#if comversion is None, remove it so it doesn't populate with 'None'
|
||||
if comversion == 'None':
|
||||
chunk_f_f = re.sub('\$VolumeN', '', mylar.CONFIG.FILE_FORMAT)
|
||||
chunk_f_f = chunk_f_f.strip().strip('\\').strip('/')
|
||||
chunk_f = re.compile(r'\s+')
|
||||
chunk_file_format = chunk_f.sub(' ', chunk_f_f)
|
||||
logger.fdebug('No version # found for series, removing from filename')
|
||||
|
@ -566,6 +567,7 @@ def rename_param(comicid, comicname, issue, ofilename, comicyear=None, issueid=N
|
|||
|
||||
if annualize is None:
|
||||
chunk_f_f = re.sub('\$Annual', '', chunk_file_format)
|
||||
chunk_f_f = chunk_f_f.strip().strip('\\').strip('/')
|
||||
chunk_f = re.compile(r'\s+')
|
||||
chunk_file_format = chunk_f.sub(' ', chunk_f_f)
|
||||
logger.fdebug('not an annual - removing from filename paramaters')
|
||||
|
|
|
@ -40,6 +40,13 @@ def movefiles(comicid, comlocation, imported):
|
|||
logger.fdebug("Renaming files not enabled, keeping original filename(s)")
|
||||
dstimp = os.path.join(comlocation, orig_filename)
|
||||
|
||||
if not os.path.exists(os.path.dirname(dstimp)):
|
||||
logger.fdebug(os.path.dirname(dstimp) + ' does not exist - attempting to create...')
|
||||
try:
|
||||
os.makedirs(os.path.dirname(dstimp), int(mylar.CONFIG.CHMOD_DIR))
|
||||
except (OSError, IOError):
|
||||
logger.fdebug('Failed to create full directory path, but will try to move file anyway.')
|
||||
|
||||
logger.info("moving " + srcimp + " ... to " + dstimp)
|
||||
try:
|
||||
shutil.move(srcimp, dstimp)
|
||||
|
|
Loading…
Reference in New Issue