1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2024-12-23 00:02:38 +00:00

Fix for OSError issues when adding comics

This commit is contained in:
evilhero 2012-10-17 11:57:51 -04:00
parent dd96a80a18
commit 4a8b22a616

View file

@ -133,9 +133,8 @@ def addComictoDB(comicid,mismatch=None):
try: try:
os.makedirs(str(comlocation)) os.makedirs(str(comlocation))
logger.info(u"Directory successfully created at: " + str(comlocation)) logger.info(u"Directory successfully created at: " + str(comlocation))
except OSError.e: except OSError:
if e.errno != errno.EEXIST: logger.error(u"Could not create comicdir : " + str(comlocation))
raise
#try to account for CV not updating new issues as fast as GCD #try to account for CV not updating new issues as fast as GCD
#seems CV doesn't update total counts #seems CV doesn't update total counts
@ -153,9 +152,8 @@ def addComictoDB(comicid,mismatch=None):
os.makedirs(str(mylar.CACHE_DIR)) os.makedirs(str(mylar.CACHE_DIR))
logger.info(u"Cache Directory successfully created at: " + str(mylar.CACHE_DIR)) logger.info(u"Cache Directory successfully created at: " + str(mylar.CACHE_DIR))
except OSError.e: except OSError:
if e.errno != errno.EEXIST: logger.error('Could not create cache dir. Check permissions of cache dir: ' + str(mylar.CACHE_DIR))
raise
coverfile = mylar.CACHE_DIR + "/" + str(comicid) + ".jpg" coverfile = mylar.CACHE_DIR + "/" + str(comicid) + ".jpg"
@ -430,9 +428,9 @@ def GCDimport(gcomicid):
try: try:
os.makedirs(str(comlocation)) os.makedirs(str(comlocation))
logger.info(u"Directory successfully created at: " + str(comlocation)) logger.info(u"Directory successfully created at: " + str(comlocation))
except OSError.e: except OSError:
if e.errno != errno.EEXIST: logger.error(u"Could not create comicdir : " + str(comlocation))
raise
comicIssues = gcdinfo['totalissues'] comicIssues = gcdinfo['totalissues']
@ -444,9 +442,8 @@ def GCDimport(gcomicid):
os.makedirs(str(mylar.CACHE_DIR)) os.makedirs(str(mylar.CACHE_DIR))
logger.info(u"Cache Directory successfully created at: " + str(mylar.CACHE_DIR)) logger.info(u"Cache Directory successfully created at: " + str(mylar.CACHE_DIR))
except OSError.e: except OSError:
if e.errno != errno.EEXIST: logger.error(u"Could not create cache dir : " + str(mylar.CACHE_DIR))
raise
coverfile = mylar.CACHE_DIR + "/" + str(gcomicid) + ".jpg" coverfile = mylar.CACHE_DIR + "/" + str(gcomicid) + ".jpg"