% from get_args import args
% from get_providers import update_throttled_provider
% update_throttled_provider()
% import ast
% import datetime
% import os
% from database import TableEpisodes, TableMovies, System
% import operator
% from config import settings
% from functools import reduce
%episodes_missing_subtitles_clause = [
% (TableEpisodes.missing_subtitles != '[]')
%]
%if settings.sonarr.getboolean('only_monitored'):
% episodes_missing_subtitles_clause.append(
% (TableEpisodes.monitored == 'True')
% )
%end
%movies_missing_subtitles_clause = [
% (TableMovies.missing_subtitles != '[]')
%]
%if settings.radarr.getboolean('only_monitored'):
% movies_missing_subtitles_clause.append(
% (TableMovies.monitored == 'True')
% )
%end
% wanted_series = TableEpisodes.select().where(reduce(operator.and_, episodes_missing_subtitles_clause)).count()
% wanted_movies = TableMovies.select().where(reduce(operator.and_, movies_missing_subtitles_clause)).count()
% from get_providers import list_throttled_providers
% throttled_providers_count = len(eval(str(settings.general.throtteled_providers)))