@ -3,14 +3,14 @@
{% block title %}Series - Bazarr{% endblock %}
{% block head %}
< style >
< style >
#seriesFanart {
background-repeat: no-repeat;
background-size: cover;
background-position: top center;
box-sizing: initial;
margin-left: -32px;
margin-top: -30 px;
margin-top: -5 px;
padding: 2em;
}
@ -41,11 +41,11 @@
white-space: nowrap;
vertical-align: middle;
}
< / style >
< / style >
{% endblock head %}
{% block bcleft %}
< div class = "" >
< div class = "" >
< button class = "btn btn-outline" id = "scan_button" >
< div > < i class = "fas fa-sync align-top text-themecolor text-center font-20" aria-hidden = "true" > < / i > < / div >
< div class = "align-bottom text-themecolor small text-center" > Scan Disk< / div >
@ -54,20 +54,20 @@
< div > < i class = "fas fa-search align-top text-themecolor text-center font-20" aria-hidden = "true" > < / i > < / div >
< div class = "align-bottom text-themecolor small text-center" > Search< / div >
< / button >
< / div >
< / div >
{% endblock bcleft %}
{% block bcright %}
< div class = "d-flex m-t-5 justify-content-end" >
< div class = "d-flex m-t-5 justify-content-end" >
< button class = "btn btn-outline" id = "edit_button" >
< div > < i class = "fas fa-wrench align-top text-themecolor text-center font-20" aria-hidden = "true" > < / i > < / div >
< div class = "align-bottom text-themecolor small text-center" > Edit Series< / div >
< / button >
< / div >
< / div >
{% endblock bcright %}
{% block body %}
< div class = "container-fluid" id = "seriesFanart" >
< div class = "container-fluid" id = "seriesFanart" >
< div class = "row justify-content-md-center" id = "seriesDetails" >
< div class = "col-sm-auto" id = "seriesPosterColumn" >
< img id = "seriesPoster" src = "" >
@ -76,7 +76,8 @@
< div class = "container-fluid" >
< div class = "row" >
< h1 > < span id = "seriesTitle" > < / span > < / h1 >
< i class = "far fa-clone" id = "seriesAlternateTitles" data-toggle = "tooltip" data-placement = "right" title = "None" data-html = "true" > < / i >
< i class = "far fa-clone" id = "seriesAlternateTitles" data-toggle = "tooltip" data-placement = "right"
title="None" data-html="true">< / i >
< / div >
< div class = "row" >
< h5 > < span id = "seriesAudioLanguage" class = "badge badge-secondary" > < / span > < / h5 >
@ -96,8 +97,9 @@
< / div >
< / div >
< / div >
< / div >
< div class = "container-fluid" >
< / div >
< div class = "container-fluid" >
<!-- ============================================================== -->
<!-- Bread crumb and right sidebar toggle -->
<!-- ============================================================== -->
< table id = "episodes" class = "table table-striped" style = "width:100%" >
@ -113,9 +115,9 @@
< / tr >
< / thead >
< / table >
< / div >
< / div >
< div id = "manualSearchModal" class = "modal" tabindex = "-1" role = "dialog" >
< div id = "manualSearchModal" class = "modal" tabindex = "-1" role = "dialog" >
< div class = "modal-dialog modal-lg" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
@ -148,9 +150,9 @@
< / div >
< / div >
< / div >
< / div >
< / div >
< div id = "uploadModal" class = "modal" tabindex = "-1" role = "dialog" >
< div id = "uploadModal" class = "modal" tabindex = "-1" role = "dialog" >
< div class = "modal-dialog modal-lg" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
@ -176,7 +178,8 @@
< / div >
< div class = "form-group col-sm-1 pl-sm-0" >
< label class = "custom-control custom-checkbox" >
< input type = "checkbox" class = "custom-control-input" id = "forced_checkbox" name = "forced" >
< input type = "checkbox" class = "custom-control-input" id = "forced_checkbox"
name="forced">
< span class = "custom-control-label" for = "forced_checkbox" > < / span >
< / label >
< / div >
@ -194,11 +197,11 @@
< / div >
< / div >
< input type = "hidden" id = "upload_episodePath" name = "episodePath" value = "" / >
< input type = "hidden" id = "upload_sceneName" name = "sceneName" value = "" / >
< input type = "hidden" id = "upload_sonarrSeriesId" name = "sonarrSeriesId" value = "" / >
< input type = "hidden" id = "upload_sonarrEpisodeId" name = "sonarrEpisodeId" value = "" / >
< input type = "hidden" id = "upload_title" name = "title" value = "" / >
< input type = "hidden" id = "upload_episodePath" name = "episodePath" value = "" / >
< input type = "hidden" id = "upload_sceneName" name = "sceneName" value = "" / >
< input type = "hidden" id = "upload_sonarrSeriesId" name = "sonarrSeriesId" value = "" / >
< input type = "hidden" id = "upload_sonarrEpisodeId" name = "sonarrEpisodeId" value = "" / >
< input type = "hidden" id = "upload_title" name = "title" value = "" / >
< / div >
< div class = "modal-footer" >
< button type = "submit" id = "upload_save_button" class = "btn btn-info" > Save< / button >
@ -207,9 +210,9 @@
< / form >
< / div >
< / div >
< / div >
< / div >
< div id = "editModal" class = "modal" tabindex = "-1" role = "dialog" >
< div id = "editModal" class = "modal" tabindex = "-1" role = "dialog" >
< div class = "modal-dialog modal-lg" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
@ -234,7 +237,8 @@
Subtitles Language(s)
< / div >
< div class = "form-group col-sm-8 pl-sm-0" >
< select class = "selectpicker" id = "edit_languages_select" name = "languages" multiple data-live-search = "true" > < / select >
< select class = "selectpicker" id = "edit_languages_select" name = "languages" multiple
data-live-search="true">< / select >
< / div >
< / div >
< div class = "row" >
@ -262,7 +266,7 @@
< / div >
< / div >
< input type = "hidden" id = "edit_sonarrSeriesId" name = "sonarrSeriesId" value = "" / >
< input type = "hidden" id = "edit_sonarrSeriesId" name = "sonarrSeriesId" value = "" / >
< / div >
< div class = "modal-footer" >
< button type = "submit" id = "edit_save_button" class = "btn btn-info" > Save< / button >
@ -271,9 +275,9 @@
< / form >
< / div >
< / div >
< / div >
< / div >
< div id = "episodeHistoryModal" class = "modal" tabindex = "-1" role = "dialog" >
< div id = "episodeHistoryModal" class = "modal" tabindex = "-1" role = "dialog" >
< div class = "modal-dialog modal-lg" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
@ -302,14 +306,14 @@
< / div >
< / div >
< / div >
< / div >
< / div >
{% endblock body %}
{% block tail %}
< script >
< script >
// make the filename appear in upload file dialog once a file have been selected.
$(document).ready(function () {
document.querySelector('.custom-file-input').addEventListener('change',function(e){
document.querySelector('.custom-file-input').addEventListener('change', function (e) {
var fileName = document.getElementById("upload").files[0].name;
var nextSibling = e.target.nextElementSibling;
nextSibling.innerText = fileName;
@ -322,26 +326,28 @@
getEnabledLanguages();
var table = $('#episodes').DataTable({
"processing": true,
"serverSide": true,
dom: "tr",
processing: true,
serverSide: true,
language: {
zeroRecords: 'No Episodes Found For This Series',
processing: "Loading Episodes..."
},
"searching" : false,
"ordering" : false,
"lengthChange" : false,
"responsive" : true,
"pageLength" : {{ settings.general.page_size }},
"ajax" : "{{ url_for('api.episodes') }}?seriesid={{id}}",
searching : false,
ordering : false,
lengthChange : false,
responsive : true,
pageLength : {{ settings.general.page_size }},
ajax : "{{ url_for('api.episodes') }}?seriesid={{id}}",
rowGroup: {
dataSrc: function (data) {
dataSrc: function (data) {
return 'Season ' + data.season;
}
},
"columns": [
{"data": "monitored",
"render": function (data, type, row) {
columns: [
{
data: "monitored",
render: function (data, type, row) {
if (data === 'False') {
return '< i class = "far fa-bookmark" data-toggle = "tooltip" data-placement = "right" title = "Episode unmonitored in Sonarr" > < / i > ';
} else if (data === 'True') {
@ -349,10 +355,11 @@
}
}
},
{"data": "episode"},
{"data": null,
"render": function (data) {
var title_path = '< a href = "" data-toggle = "tooltip" title = "Path is: '+data.mapped_path+'" data-season = '+data.season+' data-episode = '+data.episode+' data-episodeTitle = "'+data.title+'" data-sonarrEpisodeId = '+data.sonarrEpisodeId+' class = "episode_history" > '+data.title+'< / a > ';
{data: "episode"},
{
data: null,
render: function (data) {
var title_path = '< a href = "" data-toggle = "tooltip" title = "Path is: ' + data.mapped_path + '" data-season = ' + data.season + ' data-episode = ' + data.episode + ' data-episodeTitle = "' + data.title + '" data-sonarrEpisodeId = ' + data.sonarrEpisodeId + ' class = "episode_history" > ' + data.title + '< / a > ';
if (data.scene_name) {
return '< i class = "fas fa-info-circle" data-toggle = "tooltip" data-placement = "right" title = "' + data.scene_name + '" > < / i > ' + title_path;
} else {
@ -360,8 +367,9 @@
}
}
},
{"data": null,
"render": function (data) {
{
data: null,
render: function (data) {
if (data.subtitles !== 'None') {
var languages = '';
data.subtitles.forEach(appendFunc);
@ -372,15 +380,16 @@
function appendFunc(value) {
if (value[1] === null) {
languages = languages + '< span class = "badge badge-secondary" data-toggle = "tooltip" data-placement = "right" title = "' + value[0].name + ((value[0].forced) ? ' forced' :'') + '"> ' + value[0].code2 + ((value[0].forced) ? ':forced':'') + '< / span > ';
languages = languages + '< span class = "badge badge-secondary" data-toggle = "tooltip" data-placement = "right" title = "' + value[0].name + ((value[0].forced) ? ' forced' : '') + '"> ' + value[0].code2 + ((value[0].forced) ? ':forced' : '') + '< / span > ';
} else {
languages = languages + '< a href = "" class = "remove_subtitles badge badge-secondary" data-toggle = "tooltip" data-placement = "right" title = "' + value[0].name + ((value[0].forced) ? ' forced' :'') + '" data-episodePath = "' +data.mapped_path+'" data-language = "' +value[0].code3+'" data-subtitlesPath = "' +value[1]+'" data-sonarrEpisodeId = ' +data.sonarrEpisodeId+'> ' + value[0].code2 + ((value[0].forced) ? ':forced':'') + ' < i class = "far fa-trash-alt" > < / i > < / a > ';
languages = languages + '< a href = "" class = "remove_subtitles badge badge-secondary" data-toggle = "tooltip" data-placement = "right" title = "' + value[0].name + ((value[0].forced) ? ' forced' : '') + '" data-episodePath = "' + data.mapped_path + '" data-language = "' + value[0].code3 + '" data-subtitlesPath = "' + value[1] + '" data-sonarrEpisodeId = ' + data.sonarrEpisodeId + '> ' + value[0].code2 + ((value[0].forced) ? ':forced' : '') + ' < i class = "far fa-trash-alt" > < / i > < / a > ';
}
}
}
},
{"data": null,
"render": function (data) {
{
data: null,
render: function (data) {
if (data.missing_subtitles !== 'None') {
var languages = '';
data.missing_subtitles.forEach(appendFunc);
@ -390,12 +399,13 @@
}
function appendFunc(value) {
languages = languages + '< a href = "" class = "get_subtitle badge badge-secondary" data-toggle = "tooltip" data-placement = "right" title = "' + value.name + ((value.forced) ? ' forced' :'') + '" data-episodepath = "' +data.mapped_path+'" data-scenename = "' +data.scene_name+'" data-title = "' +data.title+'" data-language = "' +value.code3+'" data-hi = "' +seriesDetails.hearing_impaired+'" data-forced = "' +value.forced+'" data-sonarrepisodeid = ' +data.sonarrEpisodeId+'> ' + value.code2 + ((value.forced) ? ':forced':'') + ' < i class = "fas fa-search" > < / i > < / a > ';
languages = languages + '< a href = "" class = "get_subtitle badge badge-secondary" data-toggle = "tooltip" data-placement = "right" title = "' + value.name + ((value.forced) ? ' forced' : '') + '" data-episodepath = "' + data.mapped_path + '" data-scenename = "' + data.scene_name + '" data-title = "' + data.title + '" data-language = "' + value.code3 + '" data-hi = "' + seriesDetails.hearing_impaired + '" data-forced = "' + value.forced + '" data-sonarrepisodeid = ' + data.sonarrEpisodeId + '> ' + value.code2 + ((value.forced) ? ':forced' : '') + ' < i class = "fas fa-search" > < / i > < / a > ';
}
}
},
{"data": null,
"render": function (data) {
{
data: null,
render: function (data) {
if (data.desired_languages !== '[]') {
return '< a href = "" class = "manual_search badge badge-secondary" data-season = ' + data.season + ' data-episode = ' + data.episode + ' data-episode_title = "' + data.title + '" data-episodePath = "' + data.mapped_path + '" data-sceneName = "' + data.scene_name + '" data-language = "' + data.desired_languages + '" data-sonarrEpisodeId = ' + data.sonarrEpisodeId + ' > < i class = "fas fa-user" > < / i > < / a > ';
} else {
@ -403,10 +413,11 @@
}
}
},
{"data": null,
"render": function (data) {
{
data: null,
render: function (data) {
if (data.desired_languages !== '[]') {
return '< a href = "" class = "upload_subtitle badge badge-secondary" data-episodePath = "' +data.mapped_path+'" data-sceneName " ' + data . scene_name + ' " data-sonarrSeriesId = "' +seriesDetails['sonarrSeriesId']+'" data-sonarrEpisodeId = "' +data.sonarrEpisodeId+'" data-season = "' +data.season+'" data-episode = "' +data.episode+'" data-episode_title = "' +data.title+'"> < i class = "fas fa-cloud-upload-alt" > < / i > < / a > ';
return '< a href = "" class = "upload_subtitle badge badge-secondary" data-episodePath = "' + data.mapped_path + '" data-sceneName " ' + data . scene_name + ' " data-sonarrSeriesId = "' + seriesDetails['sonarrSeriesId'] + '" data-sonarrEpisodeId = "' + data.sonarrEpisodeId + '" data-season = "' + data.season + '" data-episode = "' + data.episode + '" data-episode_title = "' + data.title + '"> < i class = "fas fa-cloud-upload-alt" > < / i > < / a > ';
} else {
return ''
}
@ -415,7 +426,7 @@
]
});
$('#episodes').on('click', '.remove_subtitles', function(e){
$('#episodes').on('click', '.remove_subtitles', function (e) {
$(this).tooltip('dispose');
e.preventDefault();
const values = {
@ -432,13 +443,13 @@
type: "DELETE",
dataType: "json",
data: values,
beforeSend: function () {
beforeSend: function () {
cell.html('< div class = "spinner-border spinner-border-sm" role = "status" > < span class = "sr-only" > Loading...< / span > < / div > ');
}
});
});
$('#episodes').on('click', '.get_subtitle', function(e){
$('#episodes').on('click', '.get_subtitle', function (e) {
$(this).tooltip('dispose');
e.preventDefault();
const values = {
@ -457,13 +468,13 @@
type: "POST",
dataType: "json",
data: values,
beforeSend: function () {
beforeSend: function () {
cell.html('< div class = "spinner-border spinner-border-sm" role = "status" > < span class = "sr-only" > Loading...< / span > < / div > ');
}
});
});
$('#episodes').on('click', '.manual_search', function(e){
$('#episodes').on('click', '.manual_search', function (e) {
e.preventDefault();
$("#series_title_span").html(seriesDetails['title'] + ' - ' + $(this).data("season") + 'x' + $(this).data("episode") + ' - ' + $(this).data("episode_title"));
$("#episode_path_span").html($(this).attr("data-episodePath"));
@ -491,7 +502,7 @@
title: seriesDetails['title']
};
$('#search_result').DataTable( {
$('#search_result').DataTable( {
destroy: true,
language: {
zeroRecords: 'No Subtitles Found For This Episode',
@ -510,37 +521,41 @@
data: values
},
columns: [
{ data: 'score',
render: function ( data ) {
return data +'%';
{
data: 'score',
render: function (data) {
return data + '%';
}
},
{ data: null,
render: function ( data ) {
if ( data.language === "pt" & & is_pb === true & & is_pt === false) {
{
data: null,
render: function (data) {
if (data.language === "pt" & & is_pb === true & & is_pt === false) {
return 'pb'
} else {
return data.language
}
}
},
{ data: 'hearing_impaired' },
{ data: null,
render: function ( data ) {
return '< a href = "'+data.url+'" target = "_blank" > '+data.provider+'< / a > ';
{data: 'hearing_impaired'},
{
data: null,
render: function (data) {
return '< a href = "' + data.url + '" target = "_blank" > ' + data.provider + '< / a > ';
}
},
{ data: null,
render: function ( data ) {
{
data: null,
render: function (data) {
const array_matches = data.matches;
const array_dont_matches = data.dont_matches;
let i;
let text = '< div class = "dropdown" > < div class = "btn-group dropdown" > < button class = "btn btn-secondary btn-sm dropdown-toggle" type = "button" id = "dropdownMenuButton" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" > < i class = "fas fa-check-circle" style = "color: green;" > < / i > '+array_matches.length+'< / button > < div class = "dropdown-menu" aria-labelledby = "dropdownMenuButton" > ';
let text = '< div class = "dropdown" > < div class = "btn-group dropdown" > < button class = "btn btn-secondary btn-sm dropdown-toggle" type = "button" id = "dropdownMenuButton" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" > < i class = "fas fa-check-circle" style = "color: green;" > < / i > ' + array_matches.length + '< / button > < div class = "dropdown-menu" aria-labelledby = "dropdownMenuButton" > ';
for (i = 0; i < array_matches.length ; i + + ) {
text += '< a class = "dropdown-item disabled" href = "#" > ' + array_matches[i] + '< / a > ';
}
text += '< / div > ';
text += '< div class = "dropdown" > < button class = "btn btn-secondary btn-sm dropdown-toggle" type = "button" id = "dropdownMenuButton" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" > < i class = "fas fa-times-circle" style = "color: red;" > < / i > '+array_dont_matches.length+'< / button > < div class = "dropdown-menu" aria-labelledby = "dropdownMenuButton" > ';
text += '< div class = "dropdown" > < button class = "btn btn-secondary btn-sm dropdown-toggle" type = "button" id = "dropdownMenuButton" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" > < i class = "fas fa-times-circle" style = "color: red;" > < / i > ' + array_dont_matches.length + '< / button > < div class = "dropdown-menu" aria-labelledby = "dropdownMenuButton" > ';
for (i = 0; i < array_dont_matches.length ; i + + ) {
text += '< a class = "dropdown-item disabled" href = "#" > ' + array_dont_matches[i] + '< / a > ';
}
@ -548,11 +563,12 @@
return text;
}
},
{ data: null,
render: function ( data ) {
{
data: null,
render: function (data) {
const array_release_info = data.release_info;
let i;
let text = '< div class = "dropdown" > < button class = "btn btn-secondary btn-sm dropdown-toggle" type = "button" id = "dropdownMenuButton" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" > < i class = "\tfas fa-comment-dots" > < / i > '+array_release_info.length+'< / button > < div class = "dropdown-menu" aria-labelledby = "dropdownMenuButton" > ';
let text = '< div class = "dropdown" > < button class = "btn btn-secondary btn-sm dropdown-toggle" type = "button" id = "dropdownMenuButton" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" > < i class = "\tfas fa-comment-dots" > < / i > ' + array_release_info.length + '< / button > < div class = "dropdown-menu" aria-labelledby = "dropdownMenuButton" > ';
for (i = 0; i < array_release_info.length ; i + + ) {
text += '< a class = "dropdown-item" href = "#" > ' + array_release_info[i] + '< / a > ';
}
@ -560,13 +576,14 @@
return text;
}
},
{ data: null,
render: function ( data ) {
return '< a href = "" class = "manual_download badge badge-secondary" data-episodePath = "'+episodePath+'" data-sceneName = "'+sceneName+'" data-sonarrEpisodeId = '+sonarrEpisodeId+' data-subtitle = "'+data.subtitle+'" data-provider = "'+data.provider+'" data-language = "'+data.language+'" data-forced = "'+forced+'" > < i class = "fas fa-download" style = "margin-right:0px" > < / i > < / a > ';
{
data: null,
render: function (data) {
return '< a href = "" class = "manual_download badge badge-secondary" data-episodePath = "' + episodePath + '" data-sceneName = "' + sceneName + '" data-sonarrEpisodeId = ' + sonarrEpisodeId + ' data-subtitle = "' + data.subtitle + '" data-provider = "' + data.provider + '" data-language = "' + data.language + '" data-forced = "' + forced + '" > < i class = "fas fa-download" style = "margin-right:0px" > < / i > < / a > ';
}
}
]
} );
} );
$('#manualSearchModal')
.modal({
@ -574,7 +591,7 @@
});
});
$('#search_result').on('click', '.manual_download', function(e){
$('#search_result').on('click', '.manual_download', function (e) {
e.preventDefault();
const values = {
episodePath: $(this).attr("data-episodepath"),
@ -595,16 +612,16 @@
type: "POST",
dataType: "json",
data: values,
beforeSend: function () {
beforeSend: function () {
cell.html('< div class = "spinner-border spinner-border-sm" role = "status" > < span class = "sr-only" > Loading...< / span > < / div > ');
},
complete: function (data) {
complete: function (data) {
$('#manualSearchModal').modal('hide');
}
});
});
$('#episodes').on('click', '.upload_subtitle', function(e){
$('#episodes').on('click', '.upload_subtitle', function (e) {
e.preventDefault();
$("#upload_series_title_span").html(seriesDetails['title'] + ' - ' + $(this).data("season") + 'x' + $(this).data("episode") + ' - ' + $(this).data("episode_title"));
$('#upload_episodePath').val($(this).data("episodepath"));
@ -615,7 +632,7 @@
$('#manual_language_select').empty();
$.each(enabledLanguages, function (i, item) {
$('#manual_language_select').append('< option value = "' +item.code2+'"> '+item.name+'< / option > ');
$('#manual_language_select').append('< option value = "' + item.code2 + '"> ' + item.name + '< / option > ');
});
$("#manual_language_select").selectpicker("refresh");
@ -625,7 +642,7 @@
});
});
$('#upload_form').on('submit', function(e){
$('#upload_form').on('submit', function (e) {
e.preventDefault();
var formdata = new FormData(document.getElementById("upload_form"));
@ -635,41 +652,41 @@
processData: false,
contentType: false,
type: 'POST',
success: function() {
success: function () {
$('#uploadModal').modal('hide');
}
});
});
$('#scan_button').on('click', function(e){
$('#scan_button').on('click', function (e) {
e.preventDefault();
$.ajax({
url: "{{ url_for('api.episodesscandisk', seriesid=id) }}",
type: 'GET',
beforeSend: function () {
beforeSend: function () {
$('#scan_button').find("i").addClass('fa-spin');
},
complete: function () {
complete: function () {
$('#scan_button').find("i").removeClass('fa-spin');
}
});
});
$('#search_button').on('click', function(e){
$('#search_button').on('click', function (e) {
e.preventDefault();
$.ajax({
url: "{{ url_for('api.episodessearchmissing', seriesid=id) }}",
type: 'GET',
beforeSend: function () {
beforeSend: function () {
$('#search_button').find("i").addClass('fa-spin');
},
complete: function () {
complete: function () {
$('#search_button').find("i").removeClass('fa-spin');
}
});
});
$('#edit_button').on('click', function(e){
$('#edit_button').on('click', function (e) {
e.preventDefault();
$("#edit_series_title_span").html(seriesDetails['title']);
$("#edit_audio_language_span").text(seriesDetails['audio_language']['name']);
@ -682,7 +699,7 @@
$('#edit_languages_select').append('< option value = "None" > None< / option > ');
}
$.each(enabledLanguages, function (i, item) {
$('#edit_languages_select').append('< option value = "' +item.code2+'"> '+item.name+'< / option > ');
$('#edit_languages_select').append('< option value = "' + item.code2 + '"> ' + item.name + '< / option > ');
});
$("#edit_languages_select").selectpicker("refresh");
var selected_languages = Array();
@ -699,7 +716,7 @@
});
});
$('#edit_form').on('submit', function(e) {
$('#edit_form').on('submit', function (e) {
e.preventDefault();
var formdata = new FormData(document.getElementById("edit_form"));
@ -709,7 +726,7 @@
processData: false,
contentType: false,
type: 'POST',
success: function() {
success: function () {
seriesDetailsRefresh();
$('#editModal').modal('hide');
}
@ -720,7 +737,7 @@
$(this).find('form')[0].reset();
});
events.on('event', function (event) {
events.on('event', function (event) {
var event_json = JSON.parse(event);
if (event_json.series === {{id}}) {
if (event_json.type === 'series' & & event_json.action === 'update' & & event_json.episode == null) {
@ -762,7 +779,7 @@
}
});
$('#episodes').on('click', '.episode_history', function(e){
$('#episodes').on('click', '.episode_history', function (e) {
$(this).tooltip('dispose');
e.preventDefault();
@ -770,7 +787,7 @@
sonarrEpisodeId = $(this).data("sonarrepisodeid");
$('#episode_history_result').DataTable( {
$('#episode_history_result').DataTable( {
destroy: true,
language: {
zeroRecords: 'No History Records Found For This Episode'
@ -786,20 +803,28 @@
url: '{{ url_for( 'api.episodeshistory' )}}?episodeid=' + sonarrEpisodeId
},
columns: [
{ data: 'action',
"render": function(data) {
if (data === 0) {return "< i class = 'fas fa-trash' title = 'Subtitle file has been erased.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";}
else if (data === 1) {return "< i class = 'fas fa-download' title = 'Subtitle file has been downloaded.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";}
else if (data === 2) {return "< i class = 'fas fa-user' title = 'Subtitle file has been manually downloaded.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";}
else if (data === 3) {return "< i class = 'fas fa-recycle' title = 'Subtitle file has been upgraded.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";}
else if (data === 4) {return "< i class = 'fas fa-cloud-upload-alt' title = 'Subtitle file has been manually uploaded.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";}
}},
{ data: 'language' },
{ data: 'provider' },
{ data: 'score'},
{ data: 'timestamp' }
{
data: 'action',
"render": function (data) {
if (data === 0) {
return "< i class = 'fas fa-trash' title = 'Subtitle file has been erased.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";
} else if (data === 1) {
return "< i class = 'fas fa-download' title = 'Subtitle file has been downloaded.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";
} else if (data === 2) {
return "< i class = 'fas fa-user' title = 'Subtitle file has been manually downloaded.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";
} else if (data === 3) {
return "< i class = 'fas fa-recycle' title = 'Subtitle file has been upgraded.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";
} else if (data === 4) {
return "< i class = 'fas fa-cloud-upload-alt' title = 'Subtitle file has been manually uploaded.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";
}
}
},
{data: 'language'},
{data: 'provider'},
{data: 'score'},
{data: 'timestamp'}
]
} );
} );
$('#episodeHistoryModal')
.modal({
@ -856,7 +881,7 @@
function getLanguages() {
$.ajax({
url: "{{ url_for('api.languages') }}?enabled=false",
success:function (data) {
success: function (data) {
availableLanguages = data;
}
});
@ -865,10 +890,10 @@
function getEnabledLanguages() {
$.ajax({
url: "{{ url_for('api.languages') }}?enabled=true",
success:function (data) {
success: function (data) {
enabledLanguages = data;
}
});
}
< / script >
< / script >
{% endblock tail %}