FIX:(#173) If a search result contained a watchcomic title, it would match incorrectly, FIX:(#172)(#163) Post-Processing would fail on finding directory - hopefully fixed now, FIX:(#167) NZBX would fail on send to SAB, IMP:(#109) Make All Skipped Wanted option now available on Comic Details page

This commit is contained in:
evilhero 2013-01-23 02:34:50 -05:00
parent 974e49d276
commit 6ef8ab7b8d
4 changed files with 39 additions and 20 deletions

View File

@ -220,11 +220,12 @@
</select>
selected issues
<input type="hidden" value="Go">
<input type="checkbox" name="skipped2wanted" onclick="doAjaxCall('skipped2wanted?comicid=${comic['ComicID']}',$(this),'table')" value="1" data-success="Skipped Issues Changed to Wanted" style="float: right; vertical-align: middle; margin: 3px; margin-top: -1px;" /><label style="float: right; vertical-align: middle; margin: 3px; margin-top: -1px;">Change All Skipped to Wanted </label>
</div>
<table class="display" id="issue_table">
<thead>
<tr>
<th id="select"><input type="checkbox" onClick="toggle(this)" /></th>
<th id="select" align="left"><input type="checkbox" onClick="toggle(this)" class="checkbox" /></th>
<th id="issuenumber">Number</th>
<th id="issuename">Name</th>
<th id="reldate">Date</th>

View File

@ -115,6 +115,7 @@ AUTOWANT_UPCOMING = True
AUTOWANT_ALL = False
COMIC_COVER_LOCAL = False
ADD_TO_CSV = True
SKIPPED2WANTED = False
SAB_HOST = None
SAB_USERNAME = None
@ -530,7 +531,6 @@ def config_write():
new_config['General']['use_maxsize'] = int(USE_MAXSIZE)
new_config['General']['maxsize'] = MAXSIZE
new_config['General']['add_to_csv'] = int(ADD_TO_CSV)
new_config['General']['enable_extra_scripts'] = int(ENABLE_EXTRA_SCRIPTS)
new_config['General']['extra_scripts'] = EXTRA_SCRIPTS
new_config['General']['enable_pre_scripts'] = int(ENABLE_PRE_SCRIPTS)

View File

@ -503,7 +503,7 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
logger.fdebug(str(n) + " Comparing: " + str(watchcomic_split[n]) + " .to. " + str(splitit[n]))
if '+' in watchcomic_split[n]:
watchcomic_split[n] = re.sub('+', '', str(watchcomic_split[n]))
if str(watchcomic_split[n].lower()) in str(splitit[n].lower()):
if str(watchcomic_split[n].lower()) in str(splitit[n].lower()) and len(watchcomic_split[n]) >= len(splitit[n]):
logger.fdebug("word matched on : " + str(splitit[n]))
scount+=1
#elif ':' in splitit[n] or '-' in splitit[n]:
@ -607,6 +607,8 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
urllib.urlretrieve(linkapi, str(mylar.BLACKHOLE_DIR) + str(filenamenzb))
logger.fdebug("filename saved to your blackhole as : " + str(filenamenzb))
logger.info(u"Successfully sent .nzb to your Blackhole directory : " + str(mylar.BLACKHOLE_DIR) + str(filenamenzb) )
nzbname = filenamenzb[:-4]
logger.fdebug("nzb name to be used for post-processing is : " + str(nzbname))
#end blackhole
else:
@ -627,6 +629,17 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
logger.fdebug("link to retrieve via api:" + str(linkapi))
#let's change all space to decimals for simplicity
nzbname = re.sub(" ", ".", str(entry['title']))
nzbname = re.sub('[\,\:]', '', str(nzbname))
extensions = ('.cbr', '.cbz')
if nzbname.lower().endswith(extensions):
fd, ext = os.path.splitext(nzbname)
logger.fdebug("Removed extension from nzb: " + ext)
nzbname = re.sub(str(ext), '', str(nzbname))
logger.fdebug("nzbname used for post-processing:" + str(nzbname))
#we need to change the nzbx string now to allow for the nzbname rename.
if nzbprov == 'nzbx':
@ -673,22 +686,6 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
# logger.info(u"Removed temporary save file")
#raise an exception to break out of loop
#let's change all space to decimals for simplicity
if mylar.BLACKHOLE:
bhole_cname = re.sub('[/:/,\/]', '', str(ComicName))
nzbname = str(re.sub(" ", ".", str(bhole_cname))) + "." + str(IssueNumber) + ".(" + str(comyear) + ")"
else:
nzbname = re.sub(" ", ".", str(entry['title']))
nzbname = re.sub('[\,\:]', '', str(nzbname))
extensions = ('.cbr', '.cbz')
if nzbname.lower().endswith(extensions):
fd, ext = os.path.splitext(nzbname)
logger.fdebug("Removed extension from nzb: " + ext)
nzbname = re.sub(str(ext), '', str(nzbname))
logger.fdebug("nzbname used for post-processing:" + str(nzbname))
foundc = "yes"
done = True

View File

@ -70,12 +70,14 @@ class WebInterface(object):
if comic is None:
raise cherrypy.HTTPRedirect("home")
usethefuzzy = comic['UseFuzzy']
skipped2wanted = "0"
if usethefuzzy is None: usethefuzzy = "0"
comicConfig = {
"comiclocation" : mylar.COMIC_LOCATION,
"fuzzy_year0" : helpers.radio(int(usethefuzzy), 0),
"fuzzy_year1" : helpers.radio(int(usethefuzzy), 1),
"fuzzy_year2" : helpers.radio(int(usethefuzzy), 2)
"fuzzy_year2" : helpers.radio(int(usethefuzzy), 2),
"skipped2wanted" : helpers.checked(skipped2wanted)
}
return serve_template(templatename="artistredone.html", title=comic['ComicName'], comic=comic, issues=issues, comicConfig=comicConfig)
artistPage.exposed = True
@ -444,6 +446,25 @@ class WebInterface(object):
return serve_template(templatename="upcoming.html", title="Upcoming", upcoming=upcoming, issues=issues)
upcoming.exposed = True
def skipped2wanted(self, comicid):
# change all issues for a given ComicID that are Skipped, into Wanted.
issuestowanted = []
issuesnumwant = []
myDB = db.DBConnection()
skipped2 = myDB.select("SELECT * from issues WHERE ComicID=? AND Status='Skipped'", [comicid])
for skippy in skipped2:
mvcontroldict = {"IssueID": skippy['IssueID']}
mvvalues = {"Status": "Wanted"}
#print ("Changing issue " + str(skippy['Issue_Number']) + " to Wanted.")
myDB.upsert("issues", mvvalues, mvcontroldict)
issuestowanted.append(skippy['IssueID'])
issuesnumwant.append(skippy['Issue_Number'])
if len(issuestowanted) > 0 :
logger.info("Marking issues: %s as Wanted" % issuesnumwant)
threading.Thread(target=search.searchIssueIDList, args=[issuestowanted]).start()
raise cherrypy.HTTPRedirect("artistPage?ComicID=%s" % [comicid])
skipped2wanted.exposed = True
def searchScan(self, name):
return serve_template(templatename="searchfix.html", title="Manage", name=name)
searchScan.exposed = True