mirror of
https://github.com/evilhero/mylar
synced 2025-02-03 04:51:48 +00:00
Fix: allow for ',:' in search, directory creation, and post-processing IMP: Altering default comic directory
This commit is contained in:
parent
7b6389b4a4
commit
282726fd6c
3 changed files with 15 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import re
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
@ -130,6 +131,8 @@ def PostProcess(nzb_name, nzb_folder):
|
||||||
#mylar.REPLACE_CHAR ...determines what to replace spaces with underscore or dot
|
#mylar.REPLACE_CHAR ...determines what to replace spaces with underscore or dot
|
||||||
nfilename = nfilename.replace(' ', mylar.REPLACE_CHAR)
|
nfilename = nfilename.replace(' ', mylar.REPLACE_CHAR)
|
||||||
#TODO - sort issue numbering 12.00 should be 12
|
#TODO - sort issue numbering 12.00 should be 12
|
||||||
|
#replace funky characters so it doesn't break things
|
||||||
|
nfilename = re.sub('[\,\:]', '', nfilename)
|
||||||
log2screen = log2screen + "New Filename: " + nfilename + "\n"
|
log2screen = log2screen + "New Filename: " + nfilename + "\n"
|
||||||
|
|
||||||
src = nzb_folder + "/" + ofilename
|
src = nzb_folder + "/" + ofilename
|
||||||
|
|
|
@ -441,6 +441,7 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
|
||||||
#filenzb = os.path.join(tmppath,filenamenzb)
|
#filenzb = os.path.join(tmppath,filenamenzb)
|
||||||
logger.fdebug("unalterted nzb name: " + str(filenamenzb))
|
logger.fdebug("unalterted nzb name: " + str(filenamenzb))
|
||||||
#let's send a clean copy to SAB because the names are random characters and/or could be stupid.
|
#let's send a clean copy to SAB because the names are random characters and/or could be stupid.
|
||||||
|
ComicName = re.sub('[\:\,]', '', ComicName)
|
||||||
filenzb = str(ComicName.replace(' ', '_')) + "_" + str(IssueNumber) + "_(" + str(comyear) + ")"
|
filenzb = str(ComicName.replace(' ', '_')) + "_" + str(IssueNumber) + "_(" + str(comyear) + ")"
|
||||||
logger.fdebug("prettified nzb name: " + str(filenzb))
|
logger.fdebug("prettified nzb name: " + str(filenzb))
|
||||||
|
|
||||||
|
|
|
@ -531,6 +531,17 @@ class WebInterface(object):
|
||||||
#"QUALtype": qual_type,
|
#"QUALtype": qual_type,
|
||||||
#"QUALquality": qual_quality
|
#"QUALquality": qual_quality
|
||||||
#}
|
#}
|
||||||
|
#force the check/creation of directory com_location here
|
||||||
|
if os.path.isdir(str(com_location)):
|
||||||
|
logger.info(u"Validating Directory (" + str(com_location) + "). Already exists! Continuing...")
|
||||||
|
else:
|
||||||
|
logger.fdebug("Updated Directory doesn't exist! - attempting to create now.")
|
||||||
|
try:
|
||||||
|
os.makedirs(str(com_location))
|
||||||
|
logger.info(u"Directory successfully created at: " + str(com_location))
|
||||||
|
except OSError:
|
||||||
|
logger.error(u"Could not create comicdir : " + str(com_location))
|
||||||
|
|
||||||
myDB.upsert("comics", newValues, controlValueDict)
|
myDB.upsert("comics", newValues, controlValueDict)
|
||||||
raise cherrypy.HTTPRedirect("artistPage?ComicID=%s" % ComicID)
|
raise cherrypy.HTTPRedirect("artistPage?ComicID=%s" % ComicID)
|
||||||
comic_config.exposed = True
|
comic_config.exposed = True
|
||||||
|
|
Loading…
Reference in a new issue