pull/884/head
Moravčík, Marian 5 years ago
parent 2d1e734400
commit 0e500171ce

@ -133,7 +133,8 @@ a.link:hover, a.link:focus {
font-weight: 400; font-weight: 400;
border-left: 3px solid #ce2829; border-left: 3px solid #ce2829;
background: #252833; background: #252833;
padding: 8px 35px 8px 37px; } padding: 8px 35px 8px 37px;
box-shadow: 0 0 0 rgba(0, 0, 0, 0.2); }
.sidebar-nav > ul > li.active > a i { .sidebar-nav > ul > li.active > a i {
color: #ce2829; color: #ce2829;
font-size: 14px; } font-size: 14px; }
@ -294,14 +295,15 @@ a.link:hover, a.link:focus {
.page-titles { .page-titles {
background: #4f566f; background: #4f566f;
margin: 0 -30px 30px; margin: 0 -30px 5px;
min-height: 50px; min-height: 60px;
height: 50px; height: 60px;
padding: 0; padding: 0;
box-shadow: 0 0 0 rgba(0, 0, 0, 0.1); } box-shadow: 0 0 0 rgba(0, 0, 0, 0.1); }
.page-titles .btn { .page-titles .btn {
height: 50px; height: 50px;
width: 80px; } width: 70px;
padding: 0 0; }
.card-no-border .sidebar-nav > ul > li > a.active { .card-no-border .sidebar-nav > ul > li > a.active {
background: #252833; } background: #252833; }
@ -341,4 +343,40 @@ a.link:hover, a.link:focus {
background: white; background: white;
padding-bottom: 60px; } padding-bottom: 60px; }
.overlay {
display: none;
height: 100%;
width: 100%;
position: fixed;
z-index: 2147483647;
left: 0;
top: 0;
background-color: black;
background-color: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(6px);
overflow-x: hidden; }
.overlay-content {
position: relative;
top: 50%;
width: 100%;
text-align: center; }
.dataTables_wrapper {
padding-top: 0px; }
.dt-buttons {
display: inline-block;
padding-top: 0;
margin-bottom: 0; }
.tooltip {
pointer-events: none; }
table.dataTable tbody td {
vertical-align: middle; }
.container-fluid {
padding: 0 5px 25px 30px; }
/*# sourceMappingURL=bazarr.css.map */ /*# sourceMappingURL=bazarr.css.map */

File diff suppressed because one or more lines are too long

@ -197,6 +197,7 @@ a.link {
border-left: 3px solid $topbar; border-left: 3px solid $topbar;
background: $themecolor-alt; background: $themecolor-alt;
padding: 8px 35px 8px 37px; padding: 8px 35px 8px 37px;
box-shadow: 0 0 0 rgba(0, 0, 0, 0.2);
i { i {
color: $topbar; color: $topbar;
@ -439,15 +440,16 @@ a.link {
.page-titles { .page-titles {
background: #4f566f; background: #4f566f;
margin: 0 -30px 30px; margin: 0 -30px 5px;
min-height: 50px; min-height: 60px;
height: 50px; height: 60px;
padding: 0; padding: 0;
box-shadow: 0 0 0 rgba(0, 0, 0, 0.1); box-shadow: 0 0 0 rgba(0, 0, 0, 0.1);
.btn { .btn {
height: 50px; height: 50px;
width: 80px; width: 70px;
padding: 0 0;
} }
} }
@ -500,3 +502,46 @@ a.link {
background: $bodycolor; background: $bodycolor;
padding-bottom: 60px; padding-bottom: 60px;
} }
.overlay {
display: none;
height: 100%;
width: 100%;
position: fixed;
z-index: 2147483647;
left: 0;
top: 0;
background-color: rgb(0, 0, 0);
background-color: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(6px);
overflow-x: hidden;
}
.overlay-content {
position: relative;
top: 50%;
width: 100%;
text-align: center;
}
.dataTables_wrapper {
padding-top: 0px
}
.dt-buttons{
display: inline-block;
padding-top: 0;
margin-bottom: 0;
}
.tooltip {
pointer-events: none;
}
table.dataTable tbody td {
vertical-align: middle;
}
.container-fluid {
padding: 0 5px 25px 30px;
}

@ -39,34 +39,6 @@
href="{{ url_for('static',filename='plugins/datatables.net-bs4/css/dataTables.bootstrap4.min.css') }}"> href="{{ url_for('static',filename='plugins/datatables.net-bs4/css/dataTables.bootstrap4.min.css') }}">
<link rel="stylesheet" href="{{ url_for('static',filename='css/bootstrap-select.css') }}" /> <link rel="stylesheet" href="{{ url_for('static',filename='css/bootstrap-select.css') }}" />
<style>
table.dataTable tbody td {
vertical-align: middle;
}
.tooltip { pointer-events: none; }
.overlay {
display: none;
height: 100%;
width: 100%;
position: fixed;
z-index: 2147483647;
left: 0;
top: 0;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0, 0.8);
backdrop-filter: blur(6px);
overflow-x: hidden;
}
.overlay-content {
position: relative;
top: 50%;
width: 100%;
text-align: center;
}
</style>
{% endblock head_css %} {% endblock head_css %}
{% block head %} {% block head %}

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

@ -27,21 +27,22 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var table = $('#history_movies').DataTable({ var table = $('#history_movies').DataTable({
"processing": false, processing: false,
"serverSide": true, serverSide: true,
language: { language: {
zeroRecords: 'Nothing Found In Movies History', zeroRecords: 'Nothing Found In Movies History',
processing: "Loading Movies History..." processing: "Loading Movies History..."
}, },
"searching": false, searching: false,
"ordering": false, ordering: false,
"responsive": true, responsive: true,
"lengthChange": false, lengthChange: false,
"pageLength": {{ settings.general.page_size }}, pageLength: {{ settings.general.page_size }},
"ajax": "{{ url_for('api.historymovies') }}", ajax: "{{ url_for('api.historymovies') }}",
"columns": [ columns: [
{"data": "action", {
"render": function(data) { "data": "action",
"render": function (data) {
if (data === 0) { if (data === 0) {
return "<i class='fas fa-trash' title='Subtitle file has been erased.' data-toggle='tooltip' data-placement='right'></i>"; return "<i class='fas fa-trash' title='Subtitle file has been erased.' data-toggle='tooltip' data-placement='right'></i>";
} else if (data === 1) { } else if (data === 1) {
@ -55,14 +56,16 @@
} }
} }
}, },
{"data": null, {
"render": function (data) { data: null,
render: function (data) {
return '<a href="' + "{{ url_for( 'movie', no='tempvalue' ) }}".replace("tempvalue", data.radarrId) + '">' + data.title + '</a>'; return '<a href="' + "{{ url_for( 'movie', no='tempvalue' ) }}".replace("tempvalue", data.radarrId) + '">' + data.title + '</a>';
} }
}, },
{"data": "timestamp"}, {data: "timestamp"},
{"data": null, {
"render": function (data) { data: null,
render: function (data) {
if (data.upgradable) { if (data.upgradable) {
return "<i class='fas fa-recycle' title='This Subtitles File Is Eligible For An Upgrade.' style='color: green;' data-toggle='tooltip' data-placement='right'></i> " + data.description; return "<i class='fas fa-recycle' title='This Subtitles File Is Eligible For An Upgrade.' style='color: green;' data-toggle='tooltip' data-placement='right'></i> " + data.description;
} else { } else {
@ -73,10 +76,10 @@
] ]
}); });
events.on('event', function(event) { events.on('event', function (event) {
var event_json = JSON.parse(event); var event_json = JSON.parse(event);
if (event_json.type === 'movieHistory') { if (event_json.type === 'movieHistory') {
$('#history_movies').DataTable().ajax.reload(resetPaging=false); $('#history_movies').DataTable().ajax.reload(resetPaging = false);
$('[data-toggle="tooltip"]').tooltip({html: true}); $('[data-toggle="tooltip"]').tooltip({html: true});
} }
}); });

@ -29,21 +29,22 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var table = $('#history_series').DataTable({ var table = $('#history_series').DataTable({
"processing": true, processing: true,
"serverSide": true, serverSide: true,
language: { language: {
zeroRecords: 'Nothing Found In Series History', zeroRecords: 'Nothing Found In Series History',
processing: "Loading Series History..." processing: "Loading Series History..."
}, },
"searching": false, searching: false,
"ordering": false, ordering: false,
"lengthChange": false, lengthChange: false,
"responsive": true, responsive: true,
"pageLength": {{ settings.general.page_size }}, pageLength: {{ settings.general.page_size }},
"ajax": "{{ url_for('api.historyseries') }}", ajax: "{{ url_for('api.historyseries') }}",
"columns": [ columns: [
{"data": "action", {
"render": function(data) { data: "action",
render: function (data) {
if (data === 0) { if (data === 0) {
return "<i class='fas fa-trash' title='Subtitle file has been erased.' data-toggle='tooltip' data-placement='right'></i>"; return "<i class='fas fa-trash' title='Subtitle file has been erased.' data-toggle='tooltip' data-placement='right'></i>";
} else if (data === 1) { } else if (data === 1) {
@ -57,16 +58,18 @@
} }
} }
}, },
{"data": null, {
"render": function (data) { data: null,
render: function (data) {
return '<a href="' + "{{ url_for( 'episodes', no='tempvalue' ) }}".replace("tempvalue", data.sonarrSeriesId) + '">' + data.seriesTitle + '</a>'; return '<a href="' + "{{ url_for( 'episodes', no='tempvalue' ) }}".replace("tempvalue", data.sonarrSeriesId) + '">' + data.seriesTitle + '</a>';
} }
}, },
{"data": "episode_number"}, {data: "episode_number"},
{"data": "episodeTitle"}, {data: "episodeTitle"},
{"data": "timestamp"}, {data: "timestamp"},
{"data": null, {
"render": function (data) { data: null,
render: function (data) {
if (data.upgradable) { if (data.upgradable) {
return "<i class='fas fa-recycle' title='This Subtitles File Is Eligible For An Upgrade.' style='color: green;' data-toggle='tooltip' data-placement='right'></i> " + data.description; return "<i class='fas fa-recycle' title='This Subtitles File Is Eligible For An Upgrade.' style='color: green;' data-toggle='tooltip' data-placement='right'></i> " + data.description;
} else { } else {
@ -77,10 +80,10 @@
] ]
}); });
events.on('event', function(event) { events.on('event', function (event) {
var event_json = JSON.parse(event); var event_json = JSON.parse(event);
if (event_json.type === 'episodeHistory') { if (event_json.type === 'episodeHistory') {
$('#history_series').DataTable().ajax.reload(resetPaging=false); $('#history_series').DataTable().ajax.reload(resetPaging = false);
$('[data-toggle="tooltip"]').tooltip({html: true}); $('[data-toggle="tooltip"]').tooltip({html: true});
} }
}); });

@ -10,7 +10,7 @@
background-position: top center; background-position: top center;
box-sizing: initial; box-sizing: initial;
margin-left: -32px; margin-left: -32px;
margin-top: -30px; margin-top: -5px;
padding: 2em; padding: 2em;
} }

@ -4,7 +4,8 @@
{% block bcleft %} {% block bcleft %}
<div class=""> <div class="">
<button class="btn btn-outline" id="mass_edit" onclick="window.location.href = '{{ url_for('movieseditor') }}';"> <button class="btn btn-outline" id="mass_edit"
onclick="window.location.href = '{{ url_for('movieseditor') }}';">
<div><i class="fas fa-list align-top text-themecolor text-center font-20" aria-hidden="true"></i></div> <div><i class="fas fa-list align-top text-themecolor text-center font-20" aria-hidden="true"></i></div>
<div class="align-bottom text-themecolor small text-center">Mass Edit</div> <div class="align-bottom text-themecolor small text-center">Mass Edit</div>
</button> </button>
@ -56,7 +57,8 @@
Subtitles Language(s) Subtitles Language(s)
</div> </div>
<div class="form-group col-sm-8 pl-sm-0"> <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> </div>
<div class="row"> <div class="row">
@ -84,7 +86,7 @@
</div> </div>
</div> </div>
<input type="hidden" id="edit_radarrId" name="radarrId" value="" /> <input type="hidden" id="edit_radarrId" name="radarrId" value=""/>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" id="edit_save_button" class="btn btn-info">Save</button> <button type="submit" id="edit_save_button" class="btn btn-info">Save</button>
@ -102,7 +104,7 @@
getLanguages(); getLanguages();
getEnabledLanguages(); getEnabledLanguages();
events.on('event', function(event) { events.on('event', function (event) {
var event_json = JSON.parse(event); var event_json = JSON.parse(event);
if (event_json.type === 'movie' && event_json.action === 'insert') { if (event_json.type === 'movie' && event_json.action === 'insert') {
$.ajax({ $.ajax({
@ -139,21 +141,21 @@
}); });
var table = $('#movies').DataTable({ var table = $('#movies').DataTable({
"dom": dom:
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
"processing": false, processing: false,
"serverSide": true, serverSide: true,
"searching": false, searching: false,
"ordering": false, ordering: false,
"lengthChange": true, lengthChange: true,
"responsive": true, responsive: true,
"pageLength": {{ settings.general.page_size }}, pageLength: {{ settings.general.page_size }},
"ajax": "{{ url_for('api.movies') }}", ajax: "{{ url_for('api.movies') }}",
"columns": [ columns: [
{ {
"data": "monitored", data: "monitored",
"render": function (data, type, row) { render: function (data, type, row) {
if (data === 'False') { if (data === 'False') {
return '<i class="far fa-bookmark" data-toggle="tooltip" data-placement="right" title="Movie unmonitored in Radarr"></i>'; return '<i class="far fa-bookmark" data-toggle="tooltip" data-placement="right" title="Movie unmonitored in Radarr"></i>';
} else if (data === 'True') { } else if (data === 'True') {
@ -162,8 +164,8 @@
} }
}, },
{ {
"data": null, data: null,
"render": function (data) { render: function (data) {
if (data.sceneName) { if (data.sceneName) {
return '<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="right" title="' + data.sceneName + '"></i> ' + '<a href="' + "{{ url_for( 'movie', no='tempvalue' ) }}".replace("tempvalue", data.radarrId) + '">' + data.title + '</a>'; return '<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="right" title="' + data.sceneName + '"></i> ' + '<a href="' + "{{ url_for( 'movie', no='tempvalue' ) }}".replace("tempvalue", data.radarrId) + '">' + data.title + '</a>';
} else { } else {
@ -172,9 +174,9 @@
} }
}, },
{ {
"data": null, data: null,
"className": "dt-center", className: "dt-center",
"render": function (data) { render: function (data) {
if (data.exist === false) { if (data.exist === false) {
return '<i class="fas fa-exclamation-triangle" data-toggle="tooltip" data-placement="right" title="This path doesn\'t seem to be valid: ' + data.mapped_path + '"></i>'; return '<i class="fas fa-exclamation-triangle" data-toggle="tooltip" data-placement="right" title="This path doesn\'t seem to be valid: ' + data.mapped_path + '"></i>';
} else if (data.exist === true) { } else if (data.exist === true) {
@ -182,10 +184,10 @@
} }
} }
}, },
{"data": "audio_language.name"}, {data: "audio_language.name"},
{ {
"data": "languages", data: "languages",
"render": function (data) { render: function (data) {
if (data !== 'None') { if (data !== 'None') {
var languages = ''; var languages = '';
data.forEach(appendFunc); data.forEach(appendFunc);
@ -200,24 +202,24 @@
} }
}, },
{ {
"data": "hearing_impaired", data: "hearing_impaired",
"className": "dt-center" className: "dt-center"
}, },
{ {
"data": "forced", data: "forced",
"className": "dt-center" className: "dt-center"
}, },
{ {
"data": null, data: null,
"render": function (data) { render: function (data) {
return '<a href="" class="edit_button badge badge-secondary" data-radarrId='+data.radarrId+' data-audiolanguage="'+data.audio_language.name+'" data-title="'+data.title+'" data-languages='+JSON.stringify(data.languages)+' data-hi="'+data.hearing_impaired+'" data-forced="'+data.forced+'"><i class="fas fa-wrench"></i></a>'; return '<a href="" class="edit_button badge badge-secondary" data-radarrId=' + data.radarrId + ' data-audiolanguage="' + data.audio_language.name + '" data-title="' + data.title + '" data-languages=' + JSON.stringify(data.languages) + ' data-hi="' + data.hearing_impaired + '" data-forced="' + data.forced + '"><i class="fas fa-wrench"></i></a>';
} }
} }
] ]
}); });
}); });
$('#movies').on('click', '.edit_button', function(e){ $('#movies').on('click', '.edit_button', function (e) {
e.preventDefault(); e.preventDefault();
$("#edit_movies_title_span").html($(this).data('title')); $("#edit_movies_title_span").html($(this).data('title'));
$("#edit_audio_language_span").html($(this).data('audiolanguage')); $("#edit_audio_language_span").html($(this).data('audiolanguage'));
@ -232,7 +234,7 @@
$('#edit_languages_select').append('<option value="None">None</option>'); $('#edit_languages_select').append('<option value="None">None</option>');
} }
$.each(enabledLanguages, function (i, item) { $.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"); $("#edit_languages_select").selectpicker("refresh");
var selected_languages = Array(); var selected_languages = Array();
@ -249,7 +251,7 @@
}); });
}); });
$('#edit_form').on('submit', function(e){ $('#edit_form').on('submit', function (e) {
e.preventDefault(); e.preventDefault();
var formdata = new FormData(document.getElementById("edit_form")); var formdata = new FormData(document.getElementById("edit_form"));
@ -259,7 +261,7 @@
processData: false, processData: false,
contentType: false, contentType: false,
type: 'POST', type: 'POST',
success: function(){ success: function () {
$('#editModal').modal('hide'); $('#editModal').modal('hide');
} }
}); });
@ -268,7 +270,7 @@
function getLanguages() { function getLanguages() {
$.ajax({ $.ajax({
url: "{{ url_for('api.languages') }}?enabled=false", url: "{{ url_for('api.languages') }}?enabled=false",
success:function(data) { success: function (data) {
availableLanguages = data; availableLanguages = data;
} }
}); });
@ -277,7 +279,7 @@
function getEnabledLanguages() { function getEnabledLanguages() {
$.ajax({ $.ajax({
url: "{{ url_for('api.languages') }}?enabled=true", url: "{{ url_for('api.languages') }}?enabled=true",
success:function(data) { success: function (data) {
enabledLanguages = data; enabledLanguages = data;
} }
}); });

@ -63,7 +63,7 @@
getEnabledLanguages(); getEnabledLanguages();
events.on('event', function(event) { events.on('event', function (event) {
var event_json = JSON.parse(event); var event_json = JSON.parse(event);
if (event_json.type === 'movie' && event_json.action === 'insert') { if (event_json.type === 'movie' && event_json.action === 'insert') {
$.ajax({ $.ajax({
@ -106,38 +106,39 @@
$('#save_button').css('cursor', 'not-allowed'); $('#save_button').css('cursor', 'not-allowed');
var table = $('#movies').DataTable({ var table = $('#movies').DataTable({
"processing": true, processing: true,
"serverSide": true, serverSide: true,
language: { language: {
zeroRecords: 'No Movies Found', zeroRecords: 'No Movies Found',
processing: "Loading Movies..." processing: "Loading Movies..."
}, },
"searching": false, searching: false,
"ordering": false, ordering: false,
"lengthChange": true, lengthChange: true,
"responsive": true, responsive: true,
"paging": false, paging: false,
"ajax": "{{ url_for('api.movies') }}", ajax: "{{ url_for('api.movies') }}",
"columnDefs": [ { columnDefs: [{
"orderable": false, orderable: false,
"className": 'select-checkbox', className: 'select-checkbox',
"targets": 0 targets: 0
} ], }],
"select": { select: {
"style": 'multi', style: 'multi',
"selector": 'td:first-child' selector: 'td:first-child'
}, },
"columns": [ columns: [
{"defaultContent": ""}, {defaultContent: ""},
{"data": null, {
"render": function (data) { data: null,
render: function (data) {
return '<a href="' + "{{ url_for( 'movie', no='tempvalue' ) }}".replace("tempvalue", data.radarrId) + '">' + data.title + '</a>' return '<a href="' + "{{ url_for( 'movie', no='tempvalue' ) }}".replace("tempvalue", data.radarrId) + '">' + data.title + '</a>'
} }
}, },
{"data": "audio_language.name"}, {data: "audio_language.name"},
{ {
"data": "languages", data: "languages",
"render": function (data) { render: function (data) {
if (data !== 'None') { if (data !== 'None') {
var languages = ''; var languages = '';
data.forEach(appendFunc); data.forEach(appendFunc);
@ -152,42 +153,53 @@
} }
}, },
{ {
"data": "hearing_impaired", data: "hearing_impaired",
"className": "dt-center" className: "dt-center"
}, },
{ {
"data": "forced", data: "forced",
"className": "dt-center" className: "dt-center"
} }
] ]
}); });
new $.fn.dataTable.Buttons( table, { new $.fn.dataTable.Buttons(table, {
"buttons": [ buttons: [
'selectAll', {
'selectNone' extend: 'selectAll',
] text: '<div><i class="far fa-check-square align-top text-themecolor text-center font-20" aria-hidden="true"></i></div>\n' +
} ); ' <div class="align-bottom text-themecolor small text-center">Select ALL</div>'
},
{
extend: 'selectNone',
text: '<div><i class="far fa-square align-top text-themecolor text-center font-20" aria-hidden="true"></i></div>\n' +
' <div class="align-bottom text-themecolor small text-center nowrap">Deselect ALL</div>'
}]
});
table.buttons().container().appendTo('#buttons'); table.buttons().container().appendTo('#buttons');
table.on( 'select', function () { var btns = $('.dt-button');
btns.addClass('btn btn-outline');
btns.removeClass('dt-button');
table.on('select', function () {
$('.selectpicker').prop('disabled', false); $('.selectpicker').prop('disabled', false);
$('.selectpicker').selectpicker('refresh'); $('.selectpicker').selectpicker('refresh');
$('#save_button').prop('disabled', false); $('#save_button').prop('disabled', false);
$('#save_button').removeClass('disabled'); $('#save_button').removeClass('disabled');
$('#save_button').css('cursor', 'auto'); $('#save_button').css('cursor', 'auto');
} ); });
table.on( 'deselect', function () { table.on('deselect', function () {
if (table.rows( '.selected' ).count() === 0) { if (table.rows('.selected').count() === 0) {
$('.selectpicker').prop('disabled', true); $('.selectpicker').prop('disabled', true);
$('.selectpicker').selectpicker('refresh'); $('.selectpicker').selectpicker('refresh');
$('#save_button').prop('disabled', true); $('#save_button').prop('disabled', true);
$('#save_button').addClass('disabled'); $('#save_button').addClass('disabled');
$('#save_button').css('cursor', 'not-allowed'); $('#save_button').css('cursor', 'not-allowed');
} }
} ); });
if ('{{settings.general.single_language}}' === 'True') { if ('{{settings.general.single_language}}' === 'True') {
$('#languages_select').selectpicker({maxOptions: 1}); $('#languages_select').selectpicker({maxOptions: 1});
@ -195,10 +207,10 @@
$('#hi_select').selectpicker({maxOptions: 1}); $('#hi_select').selectpicker({maxOptions: 1});
$('#forced_select').selectpicker({maxOptions: 1}); $('#forced_select').selectpicker({maxOptions: 1});
$('#save_button').on('click', function(e){ $('#save_button').on('click', function (e) {
e.preventDefault(); e.preventDefault();
const values = { const values = {
radarrid: table.rows( { selected: true } ).ids().toArray(), radarrid: table.rows({selected: true}).ids().toArray(),
languages: $('#languages_select').val(), languages: $('#languages_select').val(),
hi: $('#hi_select').val(), hi: $('#hi_select').val(),
forced: $('#forced_select').val() forced: $('#forced_select').val()
@ -209,7 +221,7 @@
method: "POST", method: "POST",
data: JSON.stringify(values), data: JSON.stringify(values),
contentType: 'application/json', contentType: 'application/json',
success: function(){ success: function () {
table.rows().deselect(); table.rows().deselect();
$('#languages_select').selectpicker('val', ''); $('#languages_select').selectpicker('val', '');
$('#hi_select').selectpicker('val', ''); $('#hi_select').selectpicker('val', '');
@ -222,10 +234,10 @@
function getEnabledLanguages() { function getEnabledLanguages() {
$.ajax({ $.ajax({
url: "{{ url_for('api.languages') }}?enabled=true", url: "{{ url_for('api.languages') }}?enabled=true",
success:function(data) { success: function (data) {
$('#languages_select').append('<option value="None">None</option>'); $('#languages_select').append('<option value="None">None</option>');
$.each(data, function (i, item) { $.each(data, function (i, item) {
$('#languages_select').append('<option value="'+item.code2+'">'+item.name+'</option>'); $('#languages_select').append('<option value="' + item.code2 + '">' + item.name + '</option>');
}); });
$("#languages_select").selectpicker("refresh"); $("#languages_select").selectpicker("refresh");
} }

@ -4,7 +4,8 @@
{% block bcleft %} {% block bcleft %}
<div class=""> <div class="">
<button class="btn btn-outline" id="mass_edit" onclick="window.location.href = '{{ url_for('serieseditor') }}';"> <button class="btn btn-outline" id="mass_edit"
onclick="window.location.href = '{{ url_for('serieseditor') }}';">
<div><i class="fas fa-list align-top text-themecolor text-center font-20" aria-hidden="true"></i></div> <div><i class="fas fa-list align-top text-themecolor text-center font-20" aria-hidden="true"></i></div>
<div class="align-bottom text-themecolor small text-center">Mass Edit</div> <div class="align-bottom text-themecolor small text-center">Mass Edit</div>
</button> </button>
@ -56,7 +57,8 @@
Subtitles Language(s) Subtitles Language(s)
</div> </div>
<div class="form-group col-sm-8 pl-sm-0"> <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> </div>
<div class="row"> <div class="row">
@ -84,7 +86,7 @@
</div> </div>
</div> </div>
<input type="hidden" id="edit_sonarrSeriesId" name="sonarrSeriesId" value="" /> <input type="hidden" id="edit_sonarrSeriesId" name="sonarrSeriesId" value=""/>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" id="edit_save_button" class="btn btn-info">Save</button> <button type="submit" id="edit_save_button" class="btn btn-info">Save</button>
@ -103,7 +105,7 @@
getLanguages(); getLanguages();
getEnabledLanguages(); getEnabledLanguages();
events.on('event', function(event) { events.on('event', function (event) {
var event_json = JSON.parse(event); var event_json = JSON.parse(event);
if (event_json.type === 'series' && event_json.action === 'insert') { if (event_json.type === 'series' && event_json.action === 'insert') {
$.ajax({ $.ajax({
@ -140,29 +142,33 @@
}); });
var table = $('#series').DataTable({ var table = $('#series').DataTable({
"processing": true, dom:
"serverSide": true, "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
processing: true,
serverSide: true,
language: { language: {
zeroRecords: 'No Series Found', zeroRecords: 'No Series Found',
processing: "Loading Series..." processing: "Loading Series..."
}, },
"searching": false, searching: false,
"ordering": false, ordering: false,
"lengthChange": false, lengthChange: false,
"responsive": true, responsive: true,
"pageLength": {{ settings.general.page_size }}, pageLength: {{ settings.general.page_size }},
"ajax": "{{ url_for('api.series') }}", ajax: "{{ url_for('api.series') }}",
"columns": [ columns: [
{"data": null, {
"render": function (data) { data: null,
render: function (data) {
return '<a href="' + "{{ url_for( 'episodes', no='tempvalue' ) }}".replace("tempvalue", data.sonarrSeriesId) + '">' + data.title + '</a>'; return '<a href="' + "{{ url_for( 'episodes', no='tempvalue' ) }}".replace("tempvalue", data.sonarrSeriesId) + '">' + data.title + '</a>';
} }
}, },
{ {
"data": null, data: null,
"className": "dt-center", className: "dt-center",
"responsivePriority": 1, responsivePriority: 1,
"render": function (data) { render: function (data) {
if (data.exist === false) { if (data.exist === false) {
return '<i class="fas fa-exclamation-triangle" data-toggle="tooltip" data-placement="right" title="This path doesn\'t seem to be valid: ' + data.mapped_path + '"></i>'; return '<i class="fas fa-exclamation-triangle" data-toggle="tooltip" data-placement="right" title="This path doesn\'t seem to be valid: ' + data.mapped_path + '"></i>';
} else if (data.exist === true) { } else if (data.exist === true) {
@ -170,10 +176,10 @@
} }
} }
}, },
{"data": "audio_language.name"}, {data: "audio_language.name"},
{ {
"data": "languages", data: "languages",
"render": function (data) { render: function (data) {
if (data !== 'None') { if (data !== 'None') {
var languages = ''; var languages = '';
data.forEach(appendFunc); data.forEach(appendFunc);
@ -188,17 +194,17 @@
} }
}, },
{ {
"data": "hearing_impaired", data: "hearing_impaired",
"className": "dt-center" className: "dt-center"
}, },
{ {
"data": "forced", data: "forced",
"className": "dt-center" className: "dt-center"
}, },
{ {
"data": null, data: null,
"responsivePriority": 2, responsivePriority: 2,
"render": function (data) { render: function (data) {
var total = data.episodeFileCount; var total = data.episodeFileCount;
var completed = data.episodeFileCount - data.episodeMissingCount; var completed = data.episodeFileCount - data.episodeMissingCount;
var completed_style = ''; var completed_style = '';
@ -211,16 +217,16 @@
} }
}, },
{ {
"data": null, data: null,
"render": function (data) { render: function (data) {
return '<a href="" class="edit_button badge badge-secondary" data-sonarrSeriesId='+data.sonarrSeriesId+' data-audiolanguage="'+data.audio_language.name+'" data-title="'+data.title+'" data-languages='+JSON.stringify(data.languages)+' data-hi="'+data.hearing_impaired+'" data-forced="'+data.forced+'"><i class="fas fa-wrench"></i></a>'; return '<a href="" class="edit_button badge badge-secondary" data-sonarrSeriesId=' + data.sonarrSeriesId + ' data-audiolanguage="' + data.audio_language.name + '" data-title="' + data.title + '" data-languages=' + JSON.stringify(data.languages) + ' data-hi="' + data.hearing_impaired + '" data-forced="' + data.forced + '"><i class="fas fa-wrench"></i></a>';
} }
} }
] ]
}); });
}); });
$('#series').on('click', '.edit_button', function(e){ $('#series').on('click', '.edit_button', function (e) {
e.preventDefault(); e.preventDefault();
$("#edit_series_title_span").html($(this).data('title')); $("#edit_series_title_span").html($(this).data('title'));
$("#edit_audio_language_span").html($(this).data('audiolanguage')); $("#edit_audio_language_span").html($(this).data('audiolanguage'));
@ -235,7 +241,7 @@
$('#edit_languages_select').append('<option value="None">None</option>'); $('#edit_languages_select').append('<option value="None">None</option>');
} }
$.each(enabledLanguages, function (i, item) { $.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"); $("#edit_languages_select").selectpicker("refresh");
var selected_languages = Array(); var selected_languages = Array();
@ -252,7 +258,7 @@
}); });
}); });
$('#edit_form').on('submit', function(e){ $('#edit_form').on('submit', function (e) {
e.preventDefault(); e.preventDefault();
var formdata = new FormData(document.getElementById("edit_form")); var formdata = new FormData(document.getElementById("edit_form"));
@ -262,7 +268,7 @@
processData: false, processData: false,
contentType: false, contentType: false,
type: 'POST', type: 'POST',
success: function(){ success: function () {
$('#editModal').modal('hide'); $('#editModal').modal('hide');
} }
}); });
@ -271,7 +277,7 @@
function getLanguages() { function getLanguages() {
$.ajax({ $.ajax({
url: "{{ url_for('api.languages') }}?enabled=false", url: "{{ url_for('api.languages') }}?enabled=false",
success:function(data) { success: function (data) {
availableLanguages = data; availableLanguages = data;
} }
}); });
@ -280,7 +286,7 @@
function getEnabledLanguages() { function getEnabledLanguages() {
$.ajax({ $.ajax({
url: "{{ url_for('api.languages') }}?enabled=true", url: "{{ url_for('api.languages') }}?enabled=true",
success:function(data) { success: function (data) {
enabledLanguages = data; enabledLanguages = data;
} }
}); });

@ -63,7 +63,7 @@
getEnabledLanguages(); getEnabledLanguages();
events.on('event', function(event) { events.on('event', function (event) {
var event_json = JSON.parse(event); var event_json = JSON.parse(event);
if (event_json.type === 'series' && event_json.action === 'insert') { if (event_json.type === 'series' && event_json.action === 'insert') {
$.ajax({ $.ajax({
@ -106,38 +106,39 @@
$('#save_button').css('cursor', 'not-allowed'); $('#save_button').css('cursor', 'not-allowed');
var table = $('#series').DataTable({ var table = $('#series').DataTable({
"processing": true, processing: true,
"serverSide": true, serverSide: true,
language: { language: {
zeroRecords: 'No Series Found', zeroRecords: 'No Series Found',
processing: "Loading Series..." processing: "Loading Series..."
}, },
"searching": false, searching: false,
"ordering": false, ordering: false,
"lengthChange": true, lengthChange: true,
"responsive": true, responsive: true,
"paging": false, paging: false,
"ajax": "{{ url_for('api.series') }}", ajax: "{{ url_for('api.series') }}",
"columnDefs": [ { columnDefs: [{
"orderable": false, orderable: false,
"className": 'select-checkbox', className: 'select-checkbox',
"targets": 0 targets: 0
} ], }],
"select": { select: {
"style": 'multi', style: 'multi',
"selector": 'td:first-child' selector: 'td:first-child'
}, },
"columns": [ columns: [
{"defaultContent": ""}, {defaultContent: ""},
{"data": null, {
"render": function (data) { data: null,
render: function (data) {
return '<a href="' + "{{ url_for( 'episodes', no='tempvalue' ) }}".replace("tempvalue", data.sonarrSeriesId) + '">' + data.title + '</a>' return '<a href="' + "{{ url_for( 'episodes', no='tempvalue' ) }}".replace("tempvalue", data.sonarrSeriesId) + '">' + data.title + '</a>'
} }
}, },
{"data": "audio_language.name"}, {data: "audio_language.name"},
{ {
"data": "languages", data: "languages",
"render": function (data) { render: function (data) {
if (data !== 'None') { if (data !== 'None') {
var languages = ''; var languages = '';
data.forEach(appendFunc); data.forEach(appendFunc);
@ -151,43 +152,48 @@
} }
} }
}, },
{data: "hearing_impaired", className: "dt-center"},
{data: "forced", className: "dt-center"}
]
});
new $.fn.dataTable.Buttons(table, {
buttons: [
{ {
"data": "hearing_impaired", extend: 'selectAll',
"className": "dt-center" text: '<div><i class="far fa-check-square align-top text-themecolor text-center font-20" aria-hidden="true"></i></div>\n' +
' <div class="align-bottom text-themecolor small text-center">Select ALL</div>'
}, },
{ {
"data": "forced", extend: 'selectNone',
"className": "dt-center" text: '<div><i class="far fa-square align-top text-themecolor text-center font-20" aria-hidden="true"></i></div>\n' +
} ' <div class="align-bottom text-themecolor small text-center nowrap">Deselect ALL</div>'
] }]
}); });
new $.fn.dataTable.Buttons( table, {
"buttons": [
'selectAll',
'selectNone'
]
} );
table.buttons().container().appendTo('#buttons'); table.buttons().container().appendTo('#buttons');
table.on( 'select', function () { var btns = $('.dt-button');
btns.addClass('btn btn-outline');
btns.removeClass('dt-button');
table.on('select', function () {
$('.selectpicker').prop('disabled', false); $('.selectpicker').prop('disabled', false);
$('.selectpicker').selectpicker('refresh'); $('.selectpicker').selectpicker('refresh');
$('#save_button').prop('disabled', false); $('#save_button').prop('disabled', false);
$('#save_button').removeClass('disabled'); $('#save_button').removeClass('disabled');
$('#save_button').css('cursor', 'auto'); $('#save_button').css('cursor', 'auto');
} ); });
table.on( 'deselect', function () { table.on('deselect', function () {
if (table.rows( '.selected' ).count() === 0) { if (table.rows('.selected').count() === 0) {
$('.selectpicker').prop('disabled', true); $('.selectpicker').prop('disabled', true);
$('.selectpicker').selectpicker('refresh'); $('.selectpicker').selectpicker('refresh');
$('#save_button').prop('disabled', true); $('#save_button').prop('disabled', true);
$('#save_button').addClass('disabled'); $('#save_button').addClass('disabled');
$('#save_button').css('cursor', 'not-allowed'); $('#save_button').css('cursor', 'not-allowed');
} }
} ); });
if ('{{settings.general.single_language}}' === 'True') { if ('{{settings.general.single_language}}' === 'True') {
$('#languages_select').selectpicker({maxOptions: 1}); $('#languages_select').selectpicker({maxOptions: 1});
@ -195,10 +201,10 @@
$('#hi_select').selectpicker({maxOptions: 1}); $('#hi_select').selectpicker({maxOptions: 1});
$('#forced_select').selectpicker({maxOptions: 1}); $('#forced_select').selectpicker({maxOptions: 1});
$('#save_button').on('click', function(e){ $('#save_button').on('click', function (e) {
e.preventDefault(); e.preventDefault();
const values = { const values = {
seriesid: table.rows( { selected: true } ).ids().toArray(), seriesid: table.rows({selected: true}).ids().toArray(),
languages: $('#languages_select').val(), languages: $('#languages_select').val(),
hi: $('#hi_select').val(), hi: $('#hi_select').val(),
forced: $('#forced_select').val() forced: $('#forced_select').val()
@ -209,7 +215,7 @@
method: "POST", method: "POST",
data: JSON.stringify(values), data: JSON.stringify(values),
contentType: 'application/json', contentType: 'application/json',
success: function(){ success: function () {
table.rows().deselect(); table.rows().deselect();
$('#languages_select').selectpicker('val', ''); $('#languages_select').selectpicker('val', '');
$('#hi_select').selectpicker('val', ''); $('#hi_select').selectpicker('val', '');
@ -222,10 +228,10 @@
function getEnabledLanguages() { function getEnabledLanguages() {
$.ajax({ $.ajax({
url: "{{ url_for('api.languages') }}?enabled=true", url: "{{ url_for('api.languages') }}?enabled=true",
success:function(data) { success: function (data) {
$('#languages_select').append('<option value="None">None</option>'); $('#languages_select').append('<option value="None">None</option>');
$.each(data, function (i, item) { $.each(data, function (i, item) {
$('#languages_select').append('<option value="'+item.code2+'">'+item.name+'</option>'); $('#languages_select').append('<option value="' + item.code2 + '">' + item.name + '</option>');
}); });
$("#languages_select").selectpicker("refresh"); $("#languages_select").selectpicker("refresh");
} }

@ -28,26 +28,28 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var table = $('#wanted_movies').DataTable({ var table = $('#wanted_movies').DataTable({
"processing": true, processing: true,
"serverSide": true, serverSide: true,
language: { language: {
zeroRecords: 'No Missing Movies Subtitles', zeroRecords: 'No Missing Movies Subtitles',
processing: "Loading Missing Movies Subtitles..." processing: "Loading Missing Movies Subtitles..."
}, },
"searching": false, searching: false,
"ordering": false, ordering: false,
"lengthChange": false, lengthChange: false,
"responsive": true, responsive: true,
"pageLength": {{ settings.general.page_size }}, pageLength: {{ settings.general.page_size }},
"ajax": "{{ url_for('api.wantedmovies') }}", ajax: "{{ url_for('api.wantedmovies') }}",
"columns": [ columns: [
{"data": null, {
"render": function (data) { data: null,
render: function (data) {
return '<a href="' + "{{ url_for( 'movie', no='tempvalue' ) }}".replace("tempvalue", data.radarrId) + '">' + data.title + '</a>'; return '<a href="' + "{{ url_for( 'movie', no='tempvalue' ) }}".replace("tempvalue", data.radarrId) + '">' + data.title + '</a>';
} }
}, },
{"data": null, {
"render": function (data) { data: null,
render: function (data) {
if (data.missing_subtitles !== 'None') { if (data.missing_subtitles !== 'None') {
var languages = ''; var languages = '';
data.missing_subtitles.forEach(appendFunc); data.missing_subtitles.forEach(appendFunc);
@ -57,28 +59,28 @@
} }
function appendFunc(value) { 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-moviepath="'+data.mapped_path+'" data-scenename="'+data.sceneName+'" data-movietitle="'+data.title+'" data-language="'+value.code3+'" data-hi="'+data.hearing_impaired+'" data-forced="'+value.forced+'" data-radarrid='+data.radarrId+'>' + 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-moviepath="' + data.mapped_path + '" data-scenename="' + data.sceneName + '" data-movietitle="' + data.title + '" data-language="' + value.code3 + '" data-hi="' + data.hearing_impaired + '" data-forced="' + value.forced + '" data-radarrid=' + data.radarrId + '>' + value.code2 + ((value.forced) ? ':forced' : '') + ' <i class="fas fa-search"></i></a> ';
} }
} }
} }
] ]
}); });
$('#search_button').on('click', function(e){ $('#search_button').on('click', function (e) {
e.preventDefault(); e.preventDefault();
$.ajax({ $.ajax({
url: "{{ url_for('api.searchwantedmovies') }}", url: "{{ url_for('api.searchwantedmovies') }}",
type: 'GET', type: 'GET',
beforeSend: function() { beforeSend: function () {
$('#search_button').find("i").addClass('fa-spin'); $('#search_button').find("i").addClass('fa-spin');
}, },
complete: function() { complete: function () {
$('#search_button').find("i").removeClass('fa-spin'); $('#search_button').find("i").removeClass('fa-spin');
} }
}); });
}); });
$('#wanted_movies').on('click', '.get_subtitle', function(e){ $('#wanted_movies').on('click', '.get_subtitle', function (e) {
$(this).tooltip('dispose'); $(this).tooltip('dispose');
e.preventDefault(); e.preventDefault();
const values = { const values = {
@ -96,16 +98,16 @@
type: "POST", type: "POST",
dataType: "json", dataType: "json",
data: values, data: values,
beforeSend: function() { beforeSend: function () {
cell.html('<div class="spinner-border spinner-border-sm" role="status"><span class="sr-only">Loading...</span></div>'); cell.html('<div class="spinner-border spinner-border-sm" role="status"><span class="sr-only">Loading...</span></div>');
} }
}); });
}); });
events.on('event', function(event) { events.on('event', function (event) {
var event_json = JSON.parse(event); var event_json = JSON.parse(event);
if (event_json.type === 'movie') { if (event_json.type === 'movie') {
$('#wanted_movies').DataTable().ajax.reload(resetPaging=false); $('#wanted_movies').DataTable().ajax.reload(resetPaging = false);
$('[data-toggle="tooltip"]').tooltip({html: true}); $('[data-toggle="tooltip"]').tooltip({html: true});
} }
}); });

@ -30,28 +30,30 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var table = $('#wanted_series').DataTable({ var table = $('#wanted_series').DataTable({
"processing": true, processing: true,
"serverSide": true, serverSide: true,
language: { language: {
zeroRecords: 'No Missing Series Subtitles', zeroRecords: 'No Missing Series Subtitles',
processing: "Loading Missing Series Subtitles..." processing: "Loading Missing Series Subtitles..."
}, },
"searching": false, searching: false,
"ordering": false, ordering: false,
"lengthChange": false, lengthChange: false,
"responsive": true, responsive: true,
"pageLength": {{ settings.general.page_size }}, pageLength: {{ settings.general.page_size }},
"ajax": "{{ url_for('api.wantedseries') }}", ajax: "{{ url_for('api.wantedseries') }}",
"columns": [ columns: [
{"data": null, {
"render": function (data) { data: null,
render: function (data) {
return '<a href="' + "{{ url_for( 'episodes', no='tempvalue' ) }}".replace("tempvalue", data.sonarrSeriesId) + '">' + data.seriesTitle + '</a>'; return '<a href="' + "{{ url_for( 'episodes', no='tempvalue' ) }}".replace("tempvalue", data.sonarrSeriesId) + '">' + data.seriesTitle + '</a>';
} }
}, },
{"data": "episode_number"}, {data: "episode_number"},
{"data": "episodeTitle"}, {data: "episodeTitle"},
{"data": null, {
"render": function (data) { data: null,
render: function (data) {
if (data.missing_subtitles !== 'None') { if (data.missing_subtitles !== 'None') {
var languages = ''; var languages = '';
data.missing_subtitles.forEach(appendFunc); data.missing_subtitles.forEach(appendFunc);
@ -61,28 +63,28 @@
} }
function appendFunc(value) { 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-seriestitle="'+data.seriesTitle+'" data-language="'+value.code3+'" data-hi="'+data.hearing_impaired+'" data-forced="'+value.forced+'" data-sonarrseriesid='+data.sonarrSeriesId+' 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-seriestitle="' + data.seriesTitle + '" data-language="' + value.code3 + '" data-hi="' + data.hearing_impaired + '" data-forced="' + value.forced + '" data-sonarrseriesid=' + data.sonarrSeriesId + ' data-sonarrepisodeid=' + data.sonarrEpisodeId + '>' + value.code2 + ((value.forced) ? ':forced' : '') + ' <i class="fas fa-search"></i></a> ';
} }
} }
} }
] ]
}); });
$('#search_button').on('click', function(e){ $('#search_button').on('click', function (e) {
e.preventDefault(); e.preventDefault();
$.ajax({ $.ajax({
url: "{{ url_for('api.searchwantedseries') }}", url: "{{ url_for('api.searchwantedseries') }}",
type: 'GET', type: 'GET',
beforeSend: function() { beforeSend: function () {
$('#search_button').find("i").addClass('fa-spin'); $('#search_button').find("i").addClass('fa-spin');
}, },
complete: function() { complete: function () {
$('#search_button').find("i").removeClass('fa-spin'); $('#search_button').find("i").removeClass('fa-spin');
} }
}); });
}); });
$('#wanted_series').on('click', '.get_subtitle', function(e){ $('#wanted_series').on('click', '.get_subtitle', function (e) {
$(this).tooltip('dispose'); $(this).tooltip('dispose');
e.preventDefault(); e.preventDefault();
const values = { const values = {
@ -101,16 +103,16 @@
type: "POST", type: "POST",
dataType: "json", dataType: "json",
data: values, data: values,
beforeSend: function() { beforeSend: function () {
cell.html('<div class="spinner-border spinner-border-sm" role="status"><span class="sr-only">Loading...</span></div>'); cell.html('<div class="spinner-border spinner-border-sm" role="status"><span class="sr-only">Loading...</span></div>');
} }
}); });
}); });
events.on('event', function(event) { events.on('event', function (event) {
var event_json = JSON.parse(event); var event_json = JSON.parse(event);
if (event_json.type === 'episode') { if (event_json.type === 'episode') {
$('#wanted_series').DataTable().ajax.reload(resetPaging=false); $('#wanted_series').DataTable().ajax.reload(resetPaging = false);
$('[data-toggle="tooltip"]').tooltip({html: true}); $('[data-toggle="tooltip"]').tooltip({html: true});
} }
}); });

Loading…
Cancel
Save