Add All to Reading List Button, Account for issues renamed/rescanned after adding to reading list but before sync by ignoring stored location in readlist table and instead joining on comics and issues.

This commit is contained in:
StephenJCotton 2016-12-30 08:46:11 -05:00 committed by evilhero
parent 9d97fbdf8e
commit 47a7fb53d3
3 changed files with 11 additions and 2 deletions

View File

@ -36,6 +36,8 @@
%if annuals:
<a id="menu_link_delete" href="annualDelete?comicid=${comic['ComicID']}">Delete Annuals</a>
%endif
<a id="menu_link_addalltoRL" href="#" class="menu_link_addalltoRL">Add All to Readinglist</a>
</div>
</div>
</%def>
@ -812,6 +814,12 @@
});
});
$('#menu_link_addalltoRL').click(function(){
$('#issue_table tbody tr').each(function(){
$(this).find('a[title="Add to Reading List"]').click();
});
});
$.fn.showHideRows = function(whichClass){
var status = $('#checkboxControls > input, #'+whichClass).prop('checked')

View File

@ -156,6 +156,7 @@ function initActions() {
$("#subhead_menu #menu_link_new").button({ icons: { primary: "ui-icon-arrowreturnthick-1-s" } });
$("#subhead_menu #menu_link_shutdown").button({ icons: { primary: "ui-icon-power"} });
$("#subhead_menu #menu_link_scan").button({ icons: { primary: "ui-icon-search"} });
$("#subhead_menu #menu_link_addalltoRL").button({ icons: { primary: "ui-icon-plus"} });
}
function refreshSubmenu() {

View File

@ -134,13 +134,13 @@ class Readinglist(object):
sendlist = []
if self.filelist is None:
rl = myDB.select('SELECT * FROM readlist WHERE Status="Added"')
rl = myDB.select('SELECT issues.IssueID, comics.ComicID, comics.ComicLocation, issues.Location FROM readlist LEFT JOIN issues ON issues.IssueID = readlist.IssueID LEFT JOIN comics on comics.ComicID = issues.ComicID WHERE readlist.Status="Added"')
if rl is None:
logger.info(module + ' No issues have been marked to be synced. Aborting syncfiles')
return
for rlist in rl:
readlist.append({"filepath": rlist['Location'],
readlist.append({"filepath": os.path.join(rlist['ComicLocation'],rlist['Location']),
"issueid": rlist['IssueID'],
"comicid": rlist['ComicID']})