mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-27 01:57:33 +00:00
WIP
This commit is contained in:
parent
7661e09068
commit
5b44007bbb
1 changed files with 13 additions and 2 deletions
|
@ -75,11 +75,22 @@ class Restart(Resource):
|
||||||
class Badges(Resource):
|
class Badges(Resource):
|
||||||
@authenticate
|
@authenticate
|
||||||
def get(self):
|
def get(self):
|
||||||
|
sonarr_only_monitored_where_clause = ''
|
||||||
|
if settings.sonarr.getboolean('only_monitored'):
|
||||||
|
sonarr_only_monitored_where_clause = " AND table_episodes.monitored == 'True'"
|
||||||
|
|
||||||
|
radarr_only_monitored_where_clause = ''
|
||||||
|
if settings.radarr.getboolean('only_monitored'):
|
||||||
|
radarr_only_monitored_where_clause = " AND table_movies.monitored == 'True'"
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
"missing_episodes": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE missing_subtitles "
|
"missing_episodes": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE missing_subtitles "
|
||||||
"is not null AND missing_subtitles != '[]'", only_one=True)['count'],
|
"is not null AND missing_subtitles != '[]'" +
|
||||||
|
sonarr_only_monitored_where_clause, only_one=True)['count'],
|
||||||
|
|
||||||
"missing_movies": database.execute("SELECT COUNT(*) as count FROM table_movies WHERE missing_subtitles "
|
"missing_movies": database.execute("SELECT COUNT(*) as count FROM table_movies WHERE missing_subtitles "
|
||||||
"is not null AND missing_subtitles != '[]'", only_one=True)['count'],
|
"is not null AND missing_subtitles != '[]'" +
|
||||||
|
radarr_only_monitored_where_clause, only_one=True)['count'],
|
||||||
"throttled_providers": len(eval(str(settings.general.throtteled_providers)))
|
"throttled_providers": len(eval(str(settings.general.throtteled_providers)))
|
||||||
}
|
}
|
||||||
return jsonify(result)
|
return jsonify(result)
|
||||||
|
|
Loading…
Reference in a new issue