FIX: Fix for storyarcs not honoring the storyarc directory option when toggled off on arc detail pages (which would also call errors during post-processing). It is a global setting, and as such is only available for toggling now on the story arc main page, FIX: Story arc settings were not being updated when clicking on the Update button

This commit is contained in:
evilhero 2018-03-01 11:44:29 -05:00
parent 79a1fd7aec
commit 24512d60de
4 changed files with 28 additions and 23 deletions

View File

@ -51,10 +51,11 @@
%>
<fieldset>
<div class="row checkbox left clearfix">
%if mylar.CONFIG.STORYARCDIR:
<input type="checkbox" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="storyarcdir" id="storyarcdir" value="1" ${checked(mylar.CONFIG.STORYARCDIR)} /><label>Should I create a Story-Arc Directory?</label><br/>
<small>${sdir}</small><br/>
</br>
%if mylar.CONFIG.STORYARCDIR is True:
<label>Location: ${sdir}</label>
%endif
</br>
<!--
<input type="checkbox" style="vertical-align: middle; margin: 3px; margin-top: -1px;" /><label>Show Downloaded Story Arc Issues on ReadingList tab</label><br/>
<input type="checkbox" style="vertical-align: middle; margin: 3px; margin-top: -1px;" /><label>Enforce Renaming/MetaTagging options (if enabled)</label><br/>
@ -237,6 +238,7 @@
console.log(this);
console.log(value);
console.log(settings);
refreshTable();
return(value);
}
});

View File

@ -57,8 +57,8 @@
<div style="position:relative;left:20px;float:left;top:-30px;">
<form action="arcOptions" id="chkoptions" method="GET">
<div class="row checkbox left clearfix">
%if mylar.CONFIG.STORYARCDIR:
<input type="checkbox" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="storyarcdir" id="storyarcdir" value="1" ${checked(mylar.CONFIG.STORYARCDIR)} /><label>Should I create a Story-Arc Directory?</label><small>${sdir}</small>
%if mylar.CONFIG.STORYARCDIR is True:
<label>Location: ${sdir}</label>
%endif
</div>
<div class="row checkbox left clearfix">
@ -236,6 +236,7 @@
console.log(this);
console.log(value);
console.log(settings);
refreshTable();
return(value);
}
});

View File

@ -2682,9 +2682,9 @@ def arcformat(arc, spanyears, publisher):
elif arcpath.startswith('//'):
arcpath = arcpath[2:]
if mylar.CONFIG.STORYARCDIR:
if mylar.CONFIG.STORYARCDIR is True:
dstloc = os.path.join(mylar.CONFIG.DESTINATION_DIR, 'StoryArcs', arcpath)
elif mylar.CONFIG.COPY2ARCDIR:
elif mylar.CONFIG.COPY2ARCDIR is True:
logger.warn('Story arc directory is not configured. Defaulting to grabbag directory: ' + mylar.CONFIG.GRABBAG_DIR)
dstloc = os.path.join(mylar.CONFIG.GRABBAG_DIR, arcpath)
else:

View File

@ -4756,25 +4756,27 @@ class WebInterface(object):
readlistOptions.exposed = True
def arcOptions(self, StoryArcID=None, StoryArcName=None, read2filename=0, storyarcdir=0, arc_folderformat=None, copy2arcdir=0, arc_fileops='copy'):
mylar.CONFIG.READ2FILENAME = int(read2filename)
mylar.CONFIG.STORYARCDIR = int(storyarcdir)
mylar.CONFIG.ARC_FOLDERFORMAT = arc_folderformat
mylar.CONFIG.COPY2ARCDIR = int(copy2arcdir)
mylar.CONFIG.READ2FILENAME = bool(int(read2filename))
mylar.CONFIG.STORYARCDIR = bool(int(storyarcdir))
if arc_folderformat is None:
mylar.CONFIG.ARC_FOLDERFORMAT = "$(arc) ($spanyears)"
else:
mylar.CONFIG.ARC_FOLDERFORMAT = arc_folderformat
mylar.CONFIG.COPY2ARCDIR = bool(int(copy2arcdir))
mylar.CONFIG.ARC_FILEOPS = arc_fileops
#mylar.config_write()
logger.info(mylar.CONFIG.ARC_FOLDERFORMAT)
mylar.CONFIG.writeconfig()
#force the check/creation of directory com_location here
#if mylar.CONFIG.STORYARCDIR:
# arcdir = os.path.join(mylar.CONFIG.DESTINATION_DIR, 'StoryArcs')
# if os.path.isdir(str(arcdir)):
# logger.info(u"Validating Directory (" + str(arcdir) + "). Already exists! Continuing...")
# else:
# logger.fdebug("Updated Directory doesn't exist! - attempting to create now.")
# checkdirectory = filechecker.validateAndCreateDirectory(arcdir, True)
# if not checkdirectory:
# logger.warn('Error trying to validate/create directory. Aborting this process at this time.')
# return
if mylar.CONFIG.STORYARCDIR is True:
arcdir = os.path.join(mylar.CONFIG.DESTINATION_DIR, 'StoryArcs')
if os.path.isdir(arcdir):
logger.info('Validating Directory (%s). Already exists! Continuing...' % arcdir)
else:
logger.fdebug('Storyarc Directory doesn\'t exist! Attempting to create now.')
checkdirectory = filechecker.validateAndCreateDirectory(arcdir, True)
if not checkdirectory:
logger.warn('Error trying to validate/create directory. Aborting this process at this time.')
return
if StoryArcID is not None:
raise cherrypy.HTTPRedirect("detailStoryArc?StoryArcID=%s&StoryArcName=%s" % (StoryArcID, StoryArcName))
else: