diff --git a/gui/slick/views/manage_backlogOverview.mako b/gui/slick/views/manage_backlogOverview.mako index 637c9d1143f8c681b1f8242e1d685a78bc0e9fdd..449418457d9ecb1f435f3f0cd25912fc4d3894a7 100644 --- a/gui/slick/views/manage_backlogOverview.mako +++ b/gui/slick/views/manage_backlogOverview.mako @@ -19,13 +19,14 @@ <h1 class="title">${title}</h1> % endif -<% totalWanted = 0 %> -<% totalQual = 0 %> - -% for curShow in sickbeard.showList: - <% totalWanted = totalWanted + showCounts[curShow.indexerid][Overview.WANTED] %> - <% totalQual = totalQual + showCounts[curShow.indexerid][Overview.QUAL] %> -% endfor +<% + totalWanted = 0 + totalQual = 0 + backLogShows = sorted([x for x in sickbeard.showList if showCounts[x.indexerid][Overview.QUAL] + showCounts[x.indexerid][Overview.WANTED]], key=lambda x: x.name) + for curShow in backLogShows: + totalWanted += showCounts[curShow.indexerid][Overview.WANTED] + totalQual += showCounts[curShow.indexerid][Overview.QUAL] +%> <div class="h2footer pull-right"> <span class="listing-key wanted">Wanted: <b>${totalWanted}</b></span> @@ -35,20 +36,14 @@ <div class="float-left"> Jump to Show <select id="pickShow" class="form-control form-control-inline input-sm"> - % for curShow in sorted(sickbeard.showList, key=lambda x: x.name): - % if showCounts[curShow.indexerid][Overview.QUAL] + showCounts[curShow.indexerid][Overview.WANTED] != 0: + % for curShow in backLogShows: <option value="${curShow.indexerid}">${curShow.name}</option> - % endif % endfor </select> </div> <table class="sickbeardTable" cellspacing="0" border="0" cellpadding="0"> -% for curShow in sorted(sickbeard.showList, key=lambda x: x.name): - - % if showCounts[curShow.indexerid][Overview.QUAL] + showCounts[curShow.indexerid][Overview.WANTED] == 0: - <% continue %> - % endif +% for curShow in backLogShows: <tr class="seasonheader" id="show-${curShow.indexerid}"> <td colspan="3" class="align-left"> <br><h2><a href="${srRoot}/home/displayShow?show=${curShow.indexerid}">${curShow.name}</a></h2> @@ -63,17 +58,11 @@ Jump to Show <tr class="seasoncols"><th>Episode</th><th>Name</th><th class="nowrap">Airdate</th></tr> % for curResult in showSQLResults[curShow.indexerid]: - <% whichStr = str(curResult['season']) + 'x' + str(curResult['episode']) %> - % try: - <% overview = showCats[curShow.indexerid][whichStr] %> - % except Exception: - <% continue %> - % endtry - - % if overview not in (Overview.QUAL, Overview.WANTED): - <% continue %> - % endif - + <% + whichStr = 'S%02dE%02d' % (curResult['season'], curResult['episode']) + if whichStr not in showCats[curShow.indexerid] or showCats[curShow.indexerid][whichStr] not in (Overview.QUAL, Overview.WANTED): + continue + %> <tr class="seasonstyle ${Overview.overviewStrings[showCats[curShow.indexerid][whichStr]]}"> <td class="tableleft" align="center">${whichStr}</td> <td class="tableright" align="center" class="nowrap"> @@ -81,7 +70,7 @@ Jump to Show </td> <td> <% airDate = sbdatetime.sbdatetime.convert_to_setting(network_timezones.parse_date_time(curResult['airdate'], curShow.airs, curShow.network)) %> - % if int(curResult['airdate']) != 1: + % if int(curResult['airdate']) > 1: <time datetime="${airDate.isoformat('T')}" class="date">${sbdatetime.sbdatetime.sbfdatetime(airDate)}</time> % else: Never @@ -90,7 +79,6 @@ Jump to Show </tr> % endfor % endfor - </table> </div> </%block> diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 76d824ba05bfd16213686048fb4ab7f7c420784e..baa9380f1c216e3f0bb78a744afdea2a91a37ccf 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -3051,13 +3051,13 @@ class Manage(Home, WebRoot): epCounts[Overview.SNATCHED] = 0 sqlResults = myDB.select( - "SELECT * FROM tv_episodes WHERE tv_episodes.showid in (SELECT tv_shows.indexer_id FROM tv_shows WHERE tv_shows.indexer_id = ? AND paused = 0) ORDER BY tv_episodes.season DESC, tv_episodes.episode DESC", + "SELECT status, season, episode, name, airdate FROM tv_episodes WHERE tv_episodes.showid in (SELECT tv_shows.indexer_id FROM tv_shows WHERE tv_shows.indexer_id = ? AND paused = 0) ORDER BY tv_episodes.season DESC, tv_episodes.episode DESC", [curShow.indexerid]) for curResult in sqlResults: curEpCat = curShow.getOverview(int(curResult["status"] or -1)) if curEpCat: - epCats[str(curResult["season"]) + "x" + str(curResult["episode"])] = curEpCat + epCats['S%02dE%02d' % (curResult['season'], curResult['episode'])] = curEpCat epCounts[curEpCat] += 1 showCounts[curShow.indexerid] = epCounts @@ -3524,7 +3524,7 @@ class ManageSearches(Manage): ui.notifications.message('Find propers search started') return self.redirect("/manage/manageSearches/") - + def forceSubtitlesFinder(self): # force it to run the next time it looks result = sickbeard.subtitlesFinderScheduler.forceRun()