Commit 7b0a85e3 authored by echel0n's avatar echel0n
Browse files

Fixed issue #273 - location not found when adding/removing a show

parent 8a1fd061
# Changelog
- * 772318e - 2018-10-06: Pre-Release v9.3.80.dev4
- * 205dc97 - 2018-10-08: Fixed issue #273 - location not found when adding/removing a show
- * 8a1fd06 - 2018-10-06: Pre-Release v9.3.80.dev4
- * b85e87b - 2018-10-06: Fixed login issue for YGGTorrent
- * e3e893f - 2018-10-06: Fixed saving allowed video exts
- * be55b94 - 2018-09-22: Pre-Release v9.3.80.dev3
......
......@@ -1549,47 +1549,50 @@ def app_statistics():
max_download_count = 1000
for epData in sickrage.app.main_db.all('tv_episodes'):
showid = epData['showid']
if showid not in show_stat:
show_stat[showid] = {}
show_stat[showid]['ep_snatched'] = 0
show_stat[showid]['ep_downloaded'] = 0
show_stat[showid]['ep_total'] = 0
show_stat[showid]['ep_airs_next'] = None
show_stat[showid]['ep_airs_prev'] = None
show_stat[showid]['total_size'] = 0
season = epData['season']
episode = epData['episode']
airdate = epData['airdate']
status = epData['status']
if season > 0 and episode > 0 and airdate > 1:
if status in status_quality:
show_stat[showid]['ep_snatched'] += 1
overall_stats['episodes']['snatched'] += 1
if status in status_download:
show_stat[showid]['ep_downloaded'] += 1
overall_stats['episodes']['downloaded'] += 1
if (airdate <= today and status in [SKIPPED, WANTED, FAILED]) or (
status in status_quality + status_download):
show_stat[showid]['ep_total'] += 1
if show_stat[showid]['ep_total'] > max_download_count:
max_download_count = show_stat[showid]['ep_total']
if airdate >= today and status in [WANTED, UNAIRED] and not show_stat[showid]['ep_airs_next']:
show_stat[showid]['ep_airs_next'] = airdate
elif airdate < today > show_stat[showid]['ep_airs_prev'] and status != UNAIRED:
show_stat[showid]['ep_airs_prev'] = airdate
show_stat[showid]['total_size'] += epData['file_size']
overall_stats['episodes']['total'] += 1
overall_stats['total_size'] += epData['file_size']
for show in sickrage.app.showlist:
if sickrage.app.show_queue.is_being_added(show) or sickrage.app.show_queue.is_being_removed(show):
continue
for epData in sickrage.app.main_db.get_many('tv_episodes', show.indexerid):
if show.indexerid not in show_stat:
show_stat[show.indexerid] = {}
show_stat[show.indexerid]['ep_snatched'] = 0
show_stat[show.indexerid]['ep_downloaded'] = 0
show_stat[show.indexerid]['ep_total'] = 0
show_stat[show.indexerid]['ep_airs_next'] = None
show_stat[show.indexerid]['ep_airs_prev'] = None
show_stat[show.indexerid]['total_size'] = 0
season = epData['season']
episode = epData['episode']
airdate = epData['airdate']
status = epData['status']
if season > 0 and episode > 0 and airdate > 1:
if status in status_quality:
show_stat[show.indexerid]['ep_snatched'] += 1
overall_stats['episodes']['snatched'] += 1
if status in status_download:
show_stat[show.indexerid]['ep_downloaded'] += 1
overall_stats['episodes']['downloaded'] += 1
if (airdate <= today and status in [SKIPPED, WANTED, FAILED]) or (
status in status_quality + status_download):
show_stat[show.indexerid]['ep_total'] += 1
if show_stat[show.indexerid]['ep_total'] > max_download_count:
max_download_count = show_stat[show.indexerid]['ep_total']
if airdate >= today and status in [WANTED, UNAIRED] and not show_stat[show.indexerid]['ep_airs_next']:
show_stat[show.indexerid]['ep_airs_next'] = airdate
elif airdate < today > show_stat[show.indexerid]['ep_airs_prev'] and status != UNAIRED:
show_stat[show.indexerid]['ep_airs_prev'] = airdate
show_stat[show.indexerid]['total_size'] += epData['file_size']
overall_stats['episodes']['total'] += 1
overall_stats['total_size'] += epData['file_size']
max_download_count *= 100
......
......@@ -307,6 +307,7 @@ class LoginHandler(BaseHandler):
return super(BaseHandler, self).redirect(authorization_url)
class LogoutHandler(BaseHandler):
def __init__(self, *args, **kwargs):
super(LogoutHandler, self).__init__(*args, **kwargs)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment