Some changes

pull/884/head
Halali 5 years ago
parent 66ac35d959
commit 9662e53c16

@ -152,8 +152,8 @@ def authorize():
def api_authorize():
if 'apikey' in request.GET.dict:
if request.GET.dict['apikey'][0] == settings.auth.apikey:
if 'apikey' in request.args.dict:
if request.args.dict['apikey'][0] == settings.auth.apikey:
return
else:
abort(401, 'Unauthorized')
@ -552,8 +552,8 @@ def series():
authorize()
series_count = database.execute("SELECT COUNT(*) as count FROM table_shows", only_one=True)['count']
page = request.GET.page
if page == "":
page = request.data
if not page:
page = "1"
page_size = int(settings.general.page_size)
offset = (int(page) - 1) * page_size
@ -759,7 +759,7 @@ def movies():
authorize()
missing_count = database.execute("SELECT COUNT(*) as count FROM table_movies", only_one=True)['count']
page = request.GET.page
page = request.data
if page == "":
page = "1"
page_size = int(settings.general.page_size)
@ -947,7 +947,7 @@ def historyseries():
row_count = database.execute("SELECT COUNT(*) as count FROM table_history LEFT JOIN table_shows on "
"table_history.sonarrSeriesId = table_shows.sonarrSeriesId WHERE "
"table_shows.title is not NULL", only_one=True)['count']
page = request.GET.page
page = request.args.page
if page == "":
page = "1"
page_size = int(settings.general.page_size)
@ -1026,7 +1026,7 @@ def historymovies():
row_count = database.execute("SELECT COUNT(*) as count FROM table_history_movie LEFT JOIN table_movies ON "
"table_history_movie.radarrId=table_movies.radarrId "
"WHERE table_movies.title is not NULL", only_one=True)['count']
page = request.GET.page
page = request.args.page
if page == "":
page = "1"
page_size = int(settings.general.page_size)
@ -1114,7 +1114,7 @@ def wantedseries():
missing_count = database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE missing_subtitles != '[]'" +
monitored_only_query_string, only_one=True)['count']
page = request.GET.page
page = request.args.page
if page == "":
page = "1"
page_size = int(settings.general.page_size)
@ -1148,7 +1148,7 @@ def wantedmovies():
missing_count = database.execute("SELECT COUNT(*) as count FROM table_movies WHERE missing_subtitles != '[]'" +
monitored_only_query_string, only_one=True)['count']
page = request.GET.page
page = request.args.page
if page == "":
page = "1"
page_size = int(settings.general.page_size)

@ -108,12 +108,12 @@
<a class="item" href="{{base_url}}wanted">
<i class="warning sign icon">
% if settings.general.getboolean('use_sonarr') and wanted_series > 0:
<div class="floating ui tiny yellow label" style="left:90% !important;top:0.5em !important;">
<div id="wanted_series" class="floating ui tiny yellow label" style="left:90% !important;top:0.5em !important;">
{{wanted_series}}
</div>
% end
% if settings.general.getboolean('use_radarr') and wanted_movies > 0:
<div class="floating ui tiny green label" style="left:90% !important;top:3em !important;">
<div id="wanted_movies" class="floating ui tiny green label" style="left:90% !important;top:3em !important;">
{{wanted_movies}}
</div>
% end
@ -301,7 +301,7 @@
$('#restart_link').on('click', function(){
$('#loader_text').text("Bazarr is restarting. Please Wait...");
$.ajax({
url: "{{base_url}}restart",
url: {{url_for('restart')}},
async: true,
error: (function(){
setTimeout(function(){ setInterval(ping, 2000); },8000);
@ -309,31 +309,11 @@
})
});
% from config import settings
% from get_args import args
% ip = settings.general.ip
% port = args.port if args.port else settings.general.port
% base_url = settings.general.base_url
if ("{{ip}}" === "0.0.0.0") {
public_ip = window.location.hostname;
} else {
public_ip = "{{ip}}";
}
protocol = window.location.protocol;
if (window.location.port === '{{current_port}}') {
public_port = '{{port}}';
} else {
public_port = window.location.port;
}
function ping() {
$.ajax({
url: protocol + '//' + public_ip + ':' + public_port + '{{base_url}}',
url: {{url_for('redirect_root')}},
success: function(result) {
window.location.href= protocol + '//' + public_ip + ':' + public_port + '{{base_url}}';
window.location.href= {{url_for('redirect_root')}};
}
});
}
@ -349,9 +329,7 @@
$('#search_column').addClass('ten wide');
}
}).resize();
</script>
<script type="text/javascript">
var url_notifications = location.protocol +"//" + window.location.host + "{{base_url}}notifications";
var notificationTimeout;
var timeout;
@ -360,7 +338,7 @@
var length = {};
function doNotificationsAjax() {
$.ajax({
url: url_notifications,
url: {{url_for('notifications')}},
success: function (data) {
if (data !== "") {
data = JSON.parse(data);
@ -440,18 +418,10 @@
}
notificationTimeout = setTimeout(doNotificationsAjax, 1000);
$(window).bind('beforeunload', function(){
clearTimeout(notificationTimeout);
});
</script>
<script type="text/javascript">
var url_tasks = location.protocol +"//" + window.location.host + "{{base_url}}running_tasks";
var tasksTimeout;
function doTasksAjax() {
$.ajax({
url: url_tasks,
url: {{url_for('running_tasks_list')}},
dataType: 'json',
success: function (data) {
$('#tasks > tbody > tr').each(function() {
@ -504,5 +474,6 @@
$(window).bind('beforeunload', function(){
clearTimeout(tasksTimeout);
clearTimeout(notificationTimeout);
});
</script>

@ -448,7 +448,7 @@
{%for language in settings_languages%}
<option value="{{ language['code2'] }}">{{ language['name'] }}</option>
{%if language['enabled'] == True%}
{{ enabled_languages.append(str(language['code2']))}}
{{ enabled_languages.append(language['code2']|string)}}
{%endif%}
{%endfor%}
</select>

Loading…
Cancel
Save