Change, decouple files exist count from status set as downloaded count.

Change displayShow to include all qualities in snatch/download/archived counts.
This commit is contained in:
JackDandy 2017-12-05 15:00:09 +00:00
parent 20eb02b060
commit a6ce206c88
3 changed files with 10 additions and 4 deletions

View file

@ -169,6 +169,8 @@
* Add parse repack, proper level to recent search flow
* Change reenable Trakt Notifier to update collections at end of PP
* Fix NotifierFactory attribute enabled_ondownloadsubtitles should be enabled_onsubtitlesdownload
* Change, decouple files exist count from status set as downloaded count
* Change displayShow to include all qualities in snatch/download/archived counts
### 0.12.37 (2017-11-12 10:35:00 UTC)

View file

@ -471,15 +471,16 @@
<button type="button" class="btn btn-default pull-right allseasons"><span class="onshow">Show all</span><span class="onhide">Hide most</span><i class="icon-glyph"></i></button>
<span class="images pull-right hide"><i class="spinner"></i></span>
#end if
#set $videos = '0' if $season not in $ep_counts['videos'] else $ep_counts['videos'][$season]
#set $videos = $ep_counts['videos'].get($season, '0')
#set $season_stats = $ep_counts['status'].get($season, {})
#set $snatched = $season_stats.get($Overview.SNATCHED, None)
#set $wanted = $season_stats.get($Overview.WANTED, None)
#set $qual = $season_stats.get($Overview.QUAL, None)
#set $good = $season_stats.get($Overview.GOOD, '0')
#set $archived = False if $season not in $ep_counts['archived'] else $ep_counts['archived'][$season]
<h3>$human_season<a id="season-$season" name="season-$season"></a>
#if None is not $has_art
<span class="season-status"><span class="good status-badge">&nbsp;D: <strong>$videos</strong>&nbsp;</span>#if snatched#<span class="snatched status-badge">&nbsp;S: <strong>$snatched</strong>&nbsp;</span>#end if##if $wanted#<span class="wanted status-badge">&nbsp;W: <strong>$wanted</strong>&nbsp;</span>#end if##if $qual#<span class="qual status-badge">&nbsp;LQ: <strong>$qual</strong>&nbsp;</span>#end if#&nbsp;of&nbsp;<span class="footerhighlight">$ep_counts['totals'][$season]</span><span class="archived-count">#echo ('', '&nbsp;with <span class="footerhighlight">%s</span> archived' % $archived)[0 < $archived]#</span></span>
<span class="season-status"><span class="good status-badge">&nbsp;D: <strong>$good</strong>&nbsp;</span>#if snatched#<span class="snatched status-badge">&nbsp;S: <strong>$snatched</strong>&nbsp;</span>#end if##if $wanted#<span class="wanted status-badge">&nbsp;W: <strong>$wanted</strong>&nbsp;</span>#end if##if $qual#<span class="qual status-badge">&nbsp;LQ: <strong>$qual</strong>&nbsp;</span>#end if#&nbsp;of&nbsp;<span class="footerhighlight">$ep_counts['totals'][$season]</span>#if 0 < $archived#&nbsp;with <span class="footerhighlight">$archived</span> archived#end if##if int($videos)#&nbsp;#echo ('with', 'and')[0 < $archived]#&nbsp;<span class="footerhighlight">$videos</span> file$maybe_plural($videos)#end if#</span>
#end if
</h3>
</th>

View file

@ -1375,9 +1375,12 @@ class Home(MainHandler):
if status_overview:
ep_counts[status_overview] += row['cnt']
if ARCHIVED == Quality.splitCompositeStatus(row['status'])[0]:
ep_counts['archived'].setdefault(row['season'], row['cnt'])
ep_counts['archived'].setdefault(row['season'], 0)
ep_counts['archived'][row['season']] = row['cnt'] + ep_counts['archived'].get(row['season'], 0)
else:
ep_counts['status'].setdefault(row['season'], {status_overview: row['cnt']})
ep_counts['status'].setdefault(row['season'], {})
ep_counts['status'][row['season']][status_overview] = row['cnt'] + \
ep_counts['status'][row['season']].get(status_overview, 0)
for row in my_db.select('SELECT season, count(*) AS cnt FROM tv_episodes WHERE showid = ?'
+ ' AND \'\' != location GROUP BY season', [showObj.indexerid]):