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

FIX:(#1162) Exception when doing a Force Check Availability (or when you have anything on Auto-Want status),and multiple results are returned, IMP: Added a delete icon to allow for removal of specific items on the auto-want list (Wanted tab/ Upcoming / upcoming nodata section)

This commit is contained in:
evilhero 2015-11-18 14:39:35 -05:00
parent 626167813f
commit 300cb2ef4b
3 changed files with 37 additions and 28 deletions

View file

@ -131,12 +131,14 @@
</div>
</div>
<div id="tabs-2">
<a name="upcoming_nodata"></a>
<a id="menu_link_edit" href="future_check">Force Check Availability</a>
<div class="table_wrapper">
<table class="display_no_select" id="upcoming_table">
%if future_nodata_upcoming:
<thead>
<tr>
<th id="delcolumn"></th>
<th id="comicname">Comic</th>
<th id="issuenumber">Issue</th>
<th id="reldate">Release Date</th>
@ -146,6 +148,9 @@
<tbody>
%for f_nodata in future_nodata_upcoming:
<tr class="gradeZ">
<td id="delcolumn">
<a href="upcoming#upcoming_nodata" title="Delete series from auto-Want list" onclick="doAjaxCall('removeautowant?comicname=${f_nodata['ComicName']}&release=${f_nodata['IssueDate']}',$(this),'table')" data-success="${f_nodata['ComicName']} has been removed from the auto-want list"><img src="interfaces/default/images/skipped_icon.png" height="25" width="25" class="highqual" /></a>
</td>
%if f_nodata['ComicID'] is not None:
<td id="comicname"><a href="comicDetails?ComicID=${f_nodata['ComicID']}">${f_nodata['ComicName']}</a></td>
%else:

View file

@ -1515,6 +1515,12 @@ class WebInterface(object):
return serve_template(templatename="weeklypull.html", title="Weekly Pull", weeklyresults=weeklyresults, pulldate=pulldate['SHIPDATE'], pullfilter=True, weekfold=weekfold, wantedcount=wantedcount)
pullist.exposed = True
def removeautowant(self, comicname, release):
myDB = db.DBConnection()
logger.fdebug('Removing ' + comicname + ' from the auto-want list.')
myDB.action("DELETE FROM futureupcoming WHERE ComicName=? AND IssueDate=? AND Status='Wanted'", [comicname, release])
removeautowant.exposed = True
def futurepull(self):
from mylar import solicit
#get month-year here, and self-populate in future

View file

@ -1079,41 +1079,39 @@ def future_check():
tmpsrname = re.sub(' the ', ' ', tmpsrname.lower()).strip()
logger.fdebug('Comparing ' + tmpsrname + ' - to - ' + tmpsername)
if tmpsername.lower() == tmpsrname.lower():
logger.info('Name matched successful: ' + sr['name'])
logger.fdebug('Name matched successful: ' + sr['name'])
if str(sr['comicyear']) == str(theissdate):
logger.info('Matched to : ' + str(theissdate))
logger.fdebug('Matched to : ' + str(theissdate))
matches.append(sr)
if len(matches) == 1:
logger.info('Narrowed down to one series as a direct match: ' + matches[0]['name'] + '[' + str(matches[0]['comicid']) + ']')
cid = matches[0]['comicid']
matched = True
else:
for pos_match in matches:
length_match = len(pos_match['name']) / len(ser['ComicName'])
logger.fdebug('length match differential set for an allowance of 20%')
logger.fdebug('actual differential in length between result and series title: ' + str((length_match * 100)-100) + '%')
split_match = pos_match['name'].split()
split_series = ser['ComicName'].split()
word_match = 0
i = 0
for ss in split_series:
try:
matchword = split_match[i].lower()
except:
break
if split_match.lower().index(ss) == split_series.lower().index(ss):
#will return word position in string.
logger.fdebug('word match to position found in both strings at position : ' + str(split_match.lower().index(ss)))
word_match+=1
elif any(['the', 'and', '&'] == matchword.lower()):
logger.fdebug('common word detected of : ' + matchword)
word_match+=.5
i+=1
logger.info('word match score of : ' + str(word_match) + ' / ' + str(len(split_series)))
# elif len(searchresults) == 1:
# matched = True
# cid = searchresults[0]['comicid']
logger.info('Unable to determine a successful match at this time (this is still a WIP so it will eventually work). Not going to attempt auto-adding at this time.')
# for pos_match in matches:
# length_match = len(pos_match['name']) / len(ser['ComicName'])
# logger.fdebug('length match differential set for an allowance of 20%')
# logger.fdebug('actual differential in length between result and series title: ' + str((length_match * 100)-100) + '%')
# split_match = pos_match['name'].lower().split()
# split_series = ser['ComicName'].lower().split()
# word_match = 0
# i = 0
# for ss in split_series:
# logger.fdebug('ss value: ' + str(ss))
# try:
# matchword = split_match[i].lower()
# except:
# break
# if split_match.index(ss) == split_series.index(ss):
# #will return word position in string.
# logger.fdebug('word match to position found in both strings at position : ' + str(split_match.index(ss)))
# word_match+=1
# elif any(['the', 'and', '&'] == matchword.lower()):
# logger.fdebug('common word detected of : ' + matchword)
# word_match+=.5
# i+=1
# logger.info('word match score of : ' + str(word_match) + ' / ' + str(len(split_series)))
if matched:
#we should probably load all additional issues for the series on the futureupcoming list that are marked as Wanted and then