FIX: Fix for Story Arc detail not being accessible if story arc was not refreshed prior to attempting to load the detail page

This commit is contained in:
evilhero 2018-07-12 19:50:55 -04:00
parent 2aab239cf6
commit 33dc2ef822
1 changed files with 26 additions and 18 deletions

View File

@ -2727,11 +2727,19 @@ class WebInterface(object):
#bannerwidth = 263 #bannerwidth = 263
filepath = None filepath = None
sb = 'cache/storyarcs/' + str(arcinfo[0]['CV_ArcID']) + '-banner' sb = 'cache/storyarcs/' + str(arcinfo[0]['CV_ArcID']) + '-banner'
dir = os.listdir(os.path.join(mylar.CONFIG.CACHE_DIR, 'storyarcs')) storyarc_imagepath = os.path.join(mylar.CONFIG.CACHE_DIR, 'storyarcs')
if not os.path.exists(storyarc_imagepath):
try:
os.mkdir(storyarc_imagepath)
except:
logger.warn('Unable to create storyarc image directory @ %s' % storyarc_imagepath)
if os.path.exists(storyarc_imagepath):
dir = os.listdir(storyarc_imagepath)
for fname in dir: for fname in dir:
if str(arcinfo[0]['CV_ArcID']) in fname: if str(arcinfo[0]['CV_ArcID']) in fname:
storyarcbanner = sb storyarcbanner = sb
filepath = os.path.join(mylar.CONFIG.CACHE_DIR, 'storyarcs', fname) filepath = os.path.join(storyarc_imagepath, fname)
# if any(['H' in fname, 'W' in fname]): # if any(['H' in fname, 'W' in fname]):
# if 'H' in fname: # if 'H' in fname:
# bannerheight = int(fname[fname.find('H')+1:fname.find('.')]) # bannerheight = int(fname[fname.find('H')+1:fname.find('.')])