mirror of
https://github.com/evilhero/mylar
synced 2025-02-02 20:41:57 +00:00
Fix for comiclocation error on adding new series (directory creation). Also fixed for ',' in directory creation.
This commit is contained in:
parent
f2022def21
commit
18f719fb6d
2 changed files with 21 additions and 16 deletions
|
@ -115,12 +115,14 @@ def addComictoDB(comicid,mismatch=None):
|
|||
# setup default location here
|
||||
|
||||
if comlocation is None:
|
||||
if ':' in comic['ComicName'] or '/' in comic['ComicName']:
|
||||
if ':' in comic['ComicName'] or '/' in comic['ComicName'] or ',' in comic['ComicName']:
|
||||
comicdir = comic['ComicName']
|
||||
if ':' in comicdir:
|
||||
comicdir = comicdir.replace(':','')
|
||||
if '/' in comicdir:
|
||||
comicdir = comicdir.replace('/','-')
|
||||
if ',' in comicdir:
|
||||
comicdir = comicdir.replace(',','')
|
||||
else: comicdir = comic['ComicName']
|
||||
|
||||
series = comicdir
|
||||
|
@ -445,13 +447,14 @@ def GCDimport(gcomicid):
|
|||
#comic book location on machine
|
||||
# setup default location here
|
||||
if comlocation is None:
|
||||
if ':' in ComicName or '/' in ComicName:
|
||||
if ':' in ComicName or '/' in ComicName or ',' in ComicName:
|
||||
comicdir = ComicName
|
||||
if ':' in comicdir:
|
||||
comicdir = comicdir.replace(':','')
|
||||
if '/' in comicdir:
|
||||
comicdir = comicdir.replace('/','-')
|
||||
|
||||
if ',' in comicdir:
|
||||
comicdir = comicdir.replace(',','')
|
||||
else: comicdir = ComicName
|
||||
comlocation = mylar.DESTINATION_DIR + "/" + comicdir + " (" + ComicYear + ")"
|
||||
if mylar.DESTINATION_DIR == "":
|
||||
|
@ -568,11 +571,11 @@ def GCDimport(gcomicid):
|
|||
#---END.NEW.
|
||||
|
||||
# check if the issue already exists
|
||||
iss_exists = myDB.select('SELECT * from issues WHERE IssueID=?', [issid])
|
||||
iss_exists = myDB.action('SELECT * from issues WHERE IssueID=?', [issid]).fetchone()
|
||||
|
||||
|
||||
# Only change the status & add DateAdded if the issue is not already in the database
|
||||
if not len(iss_exists):
|
||||
if iss_exists is None:
|
||||
newValueDict['DateAdded'] = helpers.today()
|
||||
|
||||
#adjust for inconsistencies in GCD date format - some dates have ? which borks up things.
|
||||
|
|
|
@ -62,19 +62,21 @@ class WebInterface(object):
|
|||
myDB = db.DBConnection()
|
||||
comic = myDB.action('SELECT * FROM comics WHERE ComicID=?', [ComicID]).fetchone()
|
||||
issues = myDB.select('SELECT * from issues WHERE ComicID=? order by Int_IssueNumber DESC', [ComicID])
|
||||
# make sure comic dir exists..
|
||||
comlocation = comic['ComicLocation']
|
||||
if os.path.isdir(str(comlocation)): pass
|
||||
#logger.info(u"Directory (" + str(comlocation) + ") already exists! Continuing...")
|
||||
else:
|
||||
print ("Directory doesn't exist!")
|
||||
try:
|
||||
os.makedirs(str(comlocation))
|
||||
logger.info(u"No directory found - So I created one at: " + str(comlocation))
|
||||
except OSError:
|
||||
logger.error(u"Could not create directory for comic : " + str(comlocation))
|
||||
if comic is None:
|
||||
raise cherrypy.HTTPRedirect("home")
|
||||
else:
|
||||
# make sure comic dir exists..
|
||||
comlocation = comic['ComicLocation']
|
||||
if os.path.isdir(str(comlocation)): pass
|
||||
#logger.info(u"Directory (" + str(comlocation) + ") already exists! Continuing...")
|
||||
else:
|
||||
print ("Directory doesn't exist!")
|
||||
try:
|
||||
os.makedirs(str(comlocation))
|
||||
logger.info(u"No directory found - So I created one at: " + str(comlocation))
|
||||
except OSError:
|
||||
logger.error(u"Could not create directory for comic : " + str(comlocation))
|
||||
|
||||
comicConfig = {
|
||||
"comiclocation" : mylar.COMIC_LOCATION
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue