@ -1,46 +1,58 @@
<!DOCTYPE html>
< html lang = "en" >
< head >
< head >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" / >
< meta name = "mobile-web-app-capable" content = "yes" / >
< meta name = "apple-mobile-web-app-capable" content = "yes" / >
< link href = "{{ base_url}}static/noty/noty.css" rel = "stylesheet" >
< script src = "{{ base_url}}static/noty/noty.min.js" type = "text/javascript" > < / script >
< link href = "{{ base_url }}static/noty/noty.css" rel = "stylesheet" >
< script src = "{{ base_url }}static/noty/noty.min.js" type = "text/javascript" > < / script >
< style >
#divmenu {
padding-top: 1em;
}
.menu_segment {
padding: 0em !important;
border: none !important;
margin: 0em !important;
background: none !important;
}
#icon_menu {
background: transparent !important;
border: solid;
border-width: 1px;
border-color: white;
}
.prompt {
background-color: #333333 !important;
color: white !important;
border-radius: 3px !important;
}
.searchicon {
color: white !important;
}
.ui.progress .bar>.progress {
.ui.progress .bar > .progress {
right: auto;
left: .5em;
color: black !important;
}
.ui.disabled.progress.notification_progress {
opacity: unset !important;
}
div.disabled { pointer-events: none; }
button.disabled { pointer-events: none; }
div.disabled {
pointer-events: none;
}
button.disabled {
pointer-events: none;
}
@media only screen and (max-width: 1024px) {
.logo {
@ -49,88 +61,93 @@
}
}
< / style >
< / head >
< body >
% from get_args import args
% from get_providers import update_throttled_provider
% update_throttled_provider()
< / head >
< body >
% from get_args import args
% from get_providers import update_throttled_provider
% update_throttled_provider()
% import ast
% import datetime
% import os
% from database import database
% import operator
% from config import settings
% from functools import reduce
%if settings.sonarr.getboolean('only_monitored'):
% monitored_only_query_string_sonarr = ' AND monitored = "True"'
%else:
% monitored_only_query_string_sonarr = ""
%end
%if settings.radarr.getboolean('only_monitored'):
% monitored_only_query_string_radarr = ' AND monitored = "True"'
%else:
% monitored_only_query_string_radarr = ""
%end
% wanted_series = database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE missing_subtitles != '[]'" + monitored_only_query_string_sonarr, only_one=True)['count']
% wanted_movies = database.execute("SELECT COUNT(*) as count FROM table_movies WHERE missing_subtitles != '[]'" + monitored_only_query_string_radarr, only_one=True)['count']
% from get_providers import list_throttled_providers
% throttled_providers_count = len(eval(str(settings.general.throtteled_providers)))
< div id = "divmenu" class = "ui container" >
% import ast
% import datetime
% import os
% from database import database
% import operator
% from config import settings
% from functools import reduce
%if settings.sonarr.getboolean('only_monitored'):
% monitored_only_query_string_sonarr = ' AND monitored = "True"'
%else:
% monitored_only_query_string_sonarr = ""
%end
%if settings.radarr.getboolean('only_monitored'):
% monitored_only_query_string_radarr = ' AND monitored = "True"'
%else:
% monitored_only_query_string_radarr = ""
%end
% wanted_series = database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE missing_subtitles != '[]'" +
monitored_only_query_string_sonarr, only_one=True)['count']
% wanted_movies = database.execute("SELECT COUNT(*) as count FROM table_movies WHERE missing_subtitles != '[]'" +
monitored_only_query_string_radarr, only_one=True)['count']
% from get_providers import list_throttled_providers
{% set throttled_providers_count = settings.general.throtteled_providers|length %}
< div id = "divmenu" class = "ui container" >
< div class = "ui grid" >
< div class = "three wide column" >
< div class = "ui compact segment menu_segment" >
< a href = "{{ base_url}}"> < img class = "logo" src = "{{ base_url}}static/logo128.png"> < / a >
< a href = "{{ base_url }}"> < img class = "logo" src = "{{ base_url }}static/logo128.png"> < / a >
< / div >
< / div >
< div class = "ten wide right aligned compact column" >
< div id = "button_menu" class = "ui center aligned segment menu_segment" hidden = "hidden" >
< div class = "ui inverted compact borderless labeled icon massive menu menu_segment" >
% if settings.general.getboolean('use_sonarr'):
< a class = "item" href = "{{ base_url}}series">
{% if settings.general.getboolean('use_sonarr') %}
< a class = "item" href = "{{ base_url }}series">
< i class = "play icon" > < / i >
Series
< / a >
% end
% if settings.general.getboolean('use_radarr'):
< a class = "item" href = "{{ base_url}}movies">
{% endif %}
{% if settings.general.getboolean('use_radarr') %}
< a class = "item" href = "{{ base_url }}movies">
< i class = "film icon" > < / i >
Movies
< / a >
% end
< a class = "item" href = "{{ base_url}}history">
{% endif %}
< a class = "item" href = "{{ base_url }}history">
< i class = "wait icon" > < / i >
History
< / a >
< a class = "item" href = "{{ base_url}}wanted">
< a class = "item" href = "{{ base_url }}wanted">
< i class = "warning sign icon" >
% if settings.general.getboolean('use_sonarr') and wanted_series > 0:
< div id = "wanted_series" class = "floating ui tiny yellow label" style = "left:90% !important;top:0.5em !important;" >
{{wanted_series}}
{% if settings.general.getboolean('use_sonarr') and wanted_series > 0 %}
< 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 id = "wanted_movies" class = "floating ui tiny green label" style = "left:90% !important;top:3em !important;" >
{{wanted_movies}}
{% endif %}
{% if settings.general.getboolean('use_radarr') and wanted_movies > 0 %}
< div id = "wanted_movies" class = "floating ui tiny green label"
style="left:90% !important;top:3em !important;">
{{ wanted_movies }}
< / div >
% end
{% endif %}
< / i >
Wanted
< / a >
< a class = "item" href = "{{ base_url}}settings">
< a class = "item" href = "{{ base_url }}settings">
< i class = "settings icon" > < / i >
Settings
< / a >
< a class = "item" href = "{{ base_url}}system">
< a class = "item" href = "{{ base_url }}system">
< i class = "laptop icon" >
% if throttled_providers_count:
< div class = "floating ui tiny yellow label" style = "left:90% !important;top:0.5em !important;" >
{{throttled_providers_count}}
{% if throttled_providers_count %}
< div class = "floating ui tiny yellow label"
style="left:90% !important;top:0.5em !important;">
{{ throttled_providers_count }}
< / div >
% end
{% endif %}
< / i >
System
< / a >
@ -159,47 +176,48 @@
< div id = "dropdown_menu_button" class = "ui floating right dropdown item" >
< i class = "inverted bars icon" > < / i >
< div class = "ui menu" >
% if settings.general.getboolean('use_sonarr'):
< a class = "item" href = "{{ base_url}}series">
{% if settings.general.getboolean('use_sonarr') %}
< a class = "item" href = "{{ base_url }}series">
< i class = "play icon" > < / i >
Series
< / a >
% end
% if settings.general.getboolean('use_radarr'):
< a class = "item" href = "{{ base_url}}movies">
{% endif %}
{% if settings.general.getboolean('use_radarr') %}
< a class = "item" href = "{{ base_url }}movies">
< i class = "film icon" > < / i >
Movies
< / a >
% end
< a class = "item" href = "{{ base_url}}history">
{% endif %}
< a class = "item" href = "{{ base_url }}history">
< i class = "wait icon" > < / i >
History
< / a >
< a class = "item" href = "{{ base_url}}wanted">
< a class = "item" href = "{{ base_url }}wanted">
< i class = "warning sign icon" > < / i >
< span style = "margin-right: 1em;" > Wanted< / span >
% if settings.general.getboolean('use_sonarr') and wanted_series > 0:
{% if settings.general.getboolean('use_sonarr') and wanted_series > 0 %}
< div class = "ui tiny yellow label" >
{{wanted_series }}
{{ wanted_series }}
< / div >
% end
% if settings.general.getboolean('use_radarr') and wanted_movies > 0:
{% endif %}
{% if settings.general.getboolean('use_radarr') and wanted_movies > 0 %}
< div class = "ui tiny green label" >
{{wanted_movies }}
{{ wanted_movies }}
< / div >
% end
{% endif %}
< / a >
< a class = "item" href = "{{ base_url}}settings">
< a class = "item" href = "{{ base_url }}settings">
< i class = "settings icon" > < / i >
Settings
< / a >
< a class = "item" href = "{{ base_url}}system">
< a class = "item" href = "{{ base_url }}system">
< i class = "laptop icon" >
% if throttled_providers_count:
< div class = "floating ui tiny yellow label" style = "left:90% !important;top:0.5em !important;" >
{{throttled_providers_count}}
{% if throttled_providers_count %}
< div class = "floating ui tiny yellow label"
style="left:90% !important;top:0.5em !important;">
{{ throttled_providers_count }}
< / div >
% end
{% endif %}
< / i >
System
< / a >
@ -214,19 +232,32 @@
< / div >
< / div >
% restart_required = database.execute("SELECT configured, updated FROM system")
% for item in restart_required:
% restart_required = item
% break
% end
% if restart_required['updated'] == '1' and restart_required['configured'] == '1':
< div class = 'ui center aligned grid' > < div class = 'fifteen wide column' > < div class = "ui red message" > Bazarr Needs To Be Restarted To Apply The Last Update & Changes To General Settings. Click < a href = # id = "restart_link" > Here< / a > To Restart.< / div > < / div > < / div >
% elif restart_required['updated'] == '1':
< div class = 'ui center aligned grid' > < div class = 'fifteen wide column' > < div class = "ui red message" > Bazarr Needs To Be Restarted To Apply Changes To The Last Update. Click < a href = # id = "restart_link" > Here< / a > To Restart.< / div > < / div > < / div >
% elif restart_required['configured'] == '1':
< div class = 'ui center aligned grid' > < div class = 'fifteen wide column' > < div class = "ui red message" > Bazarr Needs To Be Restarted To Apply Changes To General Settings. Click < a href = # id = "restart_link" > Here< / a > To Restart.< / div > < / div > < / div >
% end
{% if update_required == '1' and restart_required == '1' %}
< div class = 'ui center aligned grid' >
< div class = 'fifteen wide column' >
< div class = "ui red message" > Bazarr Needs To Be Restarted To Apply The Last Update & Changes To General
Settings. Click < a href = # id = "restart_link" > Here< / a > To Restart.
< / div >
< / div >
< / div >
{% elif updaterequired == '1' %}
< div class = 'ui center aligned grid' >
< div class = 'fifteen wide column' >
< div class = "ui red message" > Bazarr Needs To Be Restarted To Apply Changes To The Last Update. Click < a
href=# id="restart_link">Here< / a > To Restart.
< / div >
< / div >
< / div >
{% elif restart_required == '1' %}
< div class = 'ui center aligned grid' >
< div class = 'fifteen wide column' >
< div class = "ui red message" > Bazarr Needs To Be Restarted To Apply Changes To General Settings. Click < a
href=# id="restart_link">Here< / a > To Restart.
< / div >
< / div >
< / div >
{% endif %}
% from six import PY2
% import datetime
@ -237,23 +268,30 @@
< i class = "python icon" > < / i >
< div class = "content" >
< div class = "header" > Python deprecation warning< / div >
Bazarr is now compatible with Python 3.6 and newer. You should upgrade Python as we'll drop support for Python 2.7.x by the end of 2019.
Bazarr is now compatible with Python 3.6 and newer. You should upgrade Python as we'll drop support
for Python 2.7.x by the end of 2019.
< div class = "ui bulleted list" >
% if os.name == 'posix':
< div class = "item" > If you are running under Docker, don't worry, we'll take care of this for you. Just pull the new image.< / div >
< div class = "item" > If you are running under Docker, don't worry, we'll take care of this for you.
Just pull the new image.
< / div >
% end
% if os.name == 'nt':
< div class = "item" > If you have installed using the Windows Installer, we'll provide a new installer soon.< / div >
< div class = "item" > If you have installed using the Windows Installer, we'll provide a new
installer soon.
< / div >
% end
< div class = "item" > If you are running from source, it's up to you to install Python 3 and use it to run Bazarr.< / div >
< div class = "item" > If you are running from source, it's up to you to install Python 3 and use it
to run Bazarr.
< / div >
< / div >
< / div >
< / div >
< / div >
% end
< / div >
< / body >
% end
< / div >
< / body >
< / html >
< script >
@ -263,20 +301,20 @@
.search({
apiSettings: {
url: '{{base_url}}search_json/{query}',
onResponse: function(results) {
onResponse: function (results) {
const response = {
results : []
results: []
};
$.each(results.items, function(index, item) {
$.each(results.items, function (index, item) {
response.results.push({
title : item.name,
url : item.url
title: item.name,
url: item.url
});
});
return response;
}
},
minCharacters : 2
minCharacters: 2
})
;
@ -285,41 +323,41 @@
$('.menu_segment').css('border-color', '#000000');
$('#divmenu').css('background', 'rgba(0, 0, 0, 0.8)');
$('#divmenu').css('box-shadow', '0 0 5px 5px #000000');
}
else if (window.location.href.indexOf("movie/") > -1) {
} else if (window.location.href.indexOf("movie/") > -1) {
$('.menu_segment').css('background', 'rgba(0, 0, 0, 0.9)');
$('.menu_segment').css('border-color', '#000000');
$('#divmenu').css('background', 'rgba(0, 0, 0, 0.8)');
$('#divmenu').css('box-shadow', '0 0 5px 5px #000000');
}
else {
} else {
$('.menu_segment').css('background', '#272727');
$('.menu_segment').css('border-color', '#272727');
$('#divmenu').css('background', '#272727');
}
$('#restart_link').on('click', function(){
$('#restart_link').on('click', function () {
$('#loader_text').text("Bazarr is restarting. Please Wait...");
$.ajax({
url: {{url_for('restart')}},
async: true,
error: (function(){
setTimeout(function(){ setInterval(ping, 2000); },8000);
error: (function () {
setTimeout(function () {
setInterval(ping, 2000);
}, 8000);
})
})
});
function ping() {
$.ajax({
url: {{url_for('redirect_root')}} ,
success: function (result) {
window.location.href= {{url_for('redirect_root')}} ;
url: "{{url_for('redirect_root')}}" ,
success: function (result) {
window.location.href = "{{url_for('redirect_root')}}" ;
}
});
}
$( window ).on('resize', function () {
if ($(window).width() < 1024 ) {
$(window ).on('resize', function () {
if ($(window).width() < 1024 ) {
$('#button_menu').hide();
$('#dropdown_menu').show();
$('#search_column').removeClass('ten wide');
@ -330,15 +368,16 @@
}
}).resize();
var url_notifications = location.protocol + "//" + window.location.host + "{{base_url}}notifications";
var url_notifications = location.protocol + "//" + window.location.host + "{{base_url}}notifications";
var notificationTimeout;
var timeout;
var killer;
var item = {};
var length = {};
function doNotificationsAjax() {
$.ajax({
url: {{url_for('notifications')}},
url: " {{url_for('notifications')}}" ,
success: function (data) {
if (data !== "") {
data = JSON.parse(data);
@ -368,10 +407,14 @@
}
if (button === 'refresh') {
button = [ Noty.button('Refresh', 'ui tiny primary button', function () { window.location.reload() }) ];
button = [Noty.button('Refresh', 'ui tiny primary button', function () {
window.location.reload()
})];
} else if (button === 'restart') {
// to be completed
button = [ Noty.button('Restart', 'ui tiny primary button', function () { alert('Restart Not Implemented Yet!') }) ];
button = [Noty.button('Restart', 'ui tiny primary button', function () {
alert('Restart Not Implemented Yet!')
})];
} else {
button = [];
}
@ -394,7 +437,7 @@
}).show();
$('.notification_progress').progress({
duration : 0,
duration : 0,
autoSuccess: false,
label: 'ratio',
text: {
@ -416,15 +459,17 @@
}
});
}
notificationTimeout = setTimeout(doNotificationsAjax, 1000);
var tasksTimeout;
function doTasksAjax() {
$.ajax({
url: {{url_for('running_tasks_list')}},
url: " {{url_for('running_tasks_list')}}" ,
dataType: 'json',
success: function (data) {
$('#tasks > tbody > tr').each(function() {
$('#tasks > tbody > tr').each(function () {
if ($.inArray($(this).attr('id'), data['tasks']) > -1) {
$(this).find('td:last').find('div:first').addClass('disabled');
$(this).find('td:last').find('div:first').find('i:first').addClass('loading');
@ -446,7 +491,8 @@
$('#wanted_search_missing_subtitles_movies').find('i:first').removeClass('loading');
}
%if 'no' in locals():
%
if 'no' in locals():
if ($.inArray('search_missing_subtitles_{{no}}', data['tasks']) > -1) {
$('#search_missing_subtitles').addClass('disabled');
$('#search_missing_subtitles').find('i:first').addClass('loading');
@ -462,7 +508,8 @@
$('#search_missing_subtitles_movie').removeClass('disabled');
$('#search_missing_subtitles_movie').find('i:first').removeClass('loading');
}
%end
%
end
},
complete: function (data) {
// Schedule the next
@ -470,9 +517,10 @@
}
});
}
tasksTimeout = setTimeout(doTasksAjax, 500);
$(window).bind('beforeunload', function() {
$(window).bind('beforeunload', function () {
clearTimeout(tasksTimeout);
clearTimeout(notificationTimeout);
});