Skip to content

Commit

Permalink
FIX:(#869) Unable to clear Failed downloads that have no ID value pre…
Browse files Browse the repository at this point in the history
…sent
  • Loading branch information
evilhero authored and barbequesauce committed Aug 29, 2021
1 parent 56f4f50 commit 5d095b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion data/interfaces/default/managefailed.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ <h1 class="clearfix">Manage Failed Downloads</h1>
</thead>
<tbody>
%for f in failed:
<%
f_id = f['ID']
if any([f_id is None, f_id == '']):
f_id = '%s##%s##%s##%s' % (f['IssueID'],f['Provider'],f['FileName'],f['DateFailed'])
%>
<tr>
<td id="select"><input type="checkbox" name="${f['ID']}" class="checkbox" /></td>
<td id="select"><input type="checkbox" name="${f_id}" class="checkbox" /></td>
<td id="series"><a href="comicDetails?ComicID=${f['ComicID']}">${f['Series']}</td>
<td id="issue">${f['Issue_Number']}</td>
<td id="site">${f['Provider']}</td>
Expand Down
8 changes: 6 additions & 2 deletions mylar/webserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,11 +1344,14 @@ def markentries(self, action=None, **args):
myDB = db.DBConnection()
cnt = 0
for ID in args:
logger.info(ID)
if any([ID is None, 'manage_failed_length' in ID]):
continue
else:
myDB.action("DELETE FROM Failed WHERE ID=?", [ID])
if '##' in ID:
f = ID.split('##')
myDB.action("DELETE FROM Failed WHERE IssueID=? AND Provider=? AND NZBName=? AND DateFailed=?", [f[0],f[1],f[2],f[3]])
else:
myDB.action("DELETE FROM Failed WHERE ID=?", [ID])
cnt+=1
logger.info('[DB FAILED CLEANSING] Cleared ' + str(cnt) + ' entries from the Failed DB so they will now be downloaded if available/working.')
markentries.exposed = True
Expand Down Expand Up @@ -2999,6 +3002,7 @@ def manageFailed(self):

results.append({"Series": f['ComicName'],
"ComicID": f['ComicID'],
"IssueID": f['IssueID'],
"Issue_Number": f['Issue_Number'],
"Provider": f['Provider'],
"Link": link,
Expand Down

0 comments on commit 5d095b8

Please sign in to comment.