mirror of
https://github.com/evilhero/mylar
synced 2025-02-23 14:30:31 +00:00
FIX:(#1857) When adding new comic would error if cover.jpg was to be placed in series directory
This commit is contained in:
parent
8568c41baf
commit
d12e4d779d
1 changed files with 5 additions and 2 deletions
|
@ -274,7 +274,7 @@ def addComictoDB(comicid, mismatch=None, pullupd=None, imported=None, ogcname=No
|
||||||
if mylar.CONFIG.COMIC_COVER_LOCAL and os.path.isdir(comlocation):
|
if mylar.CONFIG.COMIC_COVER_LOCAL and os.path.isdir(comlocation):
|
||||||
try:
|
try:
|
||||||
comiclocal = os.path.join(comlocation, 'cover.jpg')
|
comiclocal = os.path.join(comlocation, 'cover.jpg')
|
||||||
shutil.copyfile(coverfile, comiclocal)
|
shutil.copyfile(os.path.join(mylar.CONFIG.CACHE_DIR, str(comicid) + '.jpg'), comiclocal)
|
||||||
if mylar.CONFIG.ENFORCE_PERMS:
|
if mylar.CONFIG.ENFORCE_PERMS:
|
||||||
filechecker.setperms(comiclocal)
|
filechecker.setperms(comiclocal)
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
|
@ -352,7 +352,10 @@ def addComictoDB(comicid, mismatch=None, pullupd=None, imported=None, ogcname=No
|
||||||
if mylar.CONFIG.ALTERNATE_LATEST_SERIES_COVERS is True:
|
if mylar.CONFIG.ALTERNATE_LATEST_SERIES_COVERS is True:
|
||||||
imagetopull = myDB.selectone('SELECT issueid from issues where ComicID=? AND Int_IssueNumber=?', [comicid, helpers.issuedigits(importantdates['LatestIssue'])]).fetchone()
|
imagetopull = myDB.selectone('SELECT issueid from issues where ComicID=? AND Int_IssueNumber=?', [comicid, helpers.issuedigits(importantdates['LatestIssue'])]).fetchone()
|
||||||
imageurl = mylar.cv.getComic(comicid, 'image', issueid=imagetopull['IssueID'])
|
imageurl = mylar.cv.getComic(comicid, 'image', issueid=imagetopull['IssueID'])
|
||||||
helpers.getImage(comicid, imageurl)
|
covercheck = helpers.getImage(comicid, imageurl)
|
||||||
|
if covercheck == 'retry':
|
||||||
|
logger.info('Attempting to retrieve alternate comic image for the series.')
|
||||||
|
covercheck = helpers.getImage(comicid, comic['ComicImageALT'])
|
||||||
PRComicImage = os.path.join('cache', str(comicid) + ".jpg")
|
PRComicImage = os.path.join('cache', str(comicid) + ".jpg")
|
||||||
ComicImage = helpers.replacetheslash(PRComicImage)
|
ComicImage = helpers.replacetheslash(PRComicImage)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue