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;
border-left: 3px solid #ce2829;
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 {
color: #ce2829;
font-size: 14px; }
@ -294,14 +295,15 @@ a.link:hover, a.link:focus {
.page-titles {
background: #4f566f;
margin: 0 -30px 30px;
min-height: 50px;
height: 50px;
margin: 0 -30px 5px;
min-height: 60px;
height: 60px;
padding: 0;
box-shadow: 0 0 0 rgba(0, 0, 0, 0.1); }
.page-titles .btn {
height: 50px;
width: 80px; }
width: 70px;
padding: 0 0; }
.card-no-border .sidebar-nav > ul > li > a.active {
background: #252833; }
@ -341,4 +343,40 @@ a.link:hover, a.link:focus {
background: white;
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 */

File diff suppressed because one or more lines are too long

@ -197,6 +197,7 @@ a.link {
border-left: 3px solid $topbar;
background: $themecolor-alt;
padding: 8px 35px 8px 37px;
box-shadow: 0 0 0 rgba(0, 0, 0, 0.2);
i {
color: $topbar;
@ -439,15 +440,16 @@ a.link {
.page-titles {
background: #4f566f;
margin: 0 -30px 30px;
min-height: 50px;
height: 50px;
margin: 0 -30px 5px;
min-height: 60px;
height: 60px;
padding: 0;
box-shadow: 0 0 0 rgba(0, 0, 0, 0.1);
.btn {
height: 50px;
width: 80px;
width: 70px;
padding: 0 0;
}
}
@ -499,4 +501,47 @@ a.link {
.page-wrapper {
background: $bodycolor;
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') }}">
<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 %}
{% block head %}

File diff suppressed because it is too large Load Diff

@ -27,21 +27,22 @@
<script>
$(document).ready(function () {
var table = $('#history_movies').DataTable({
"processing": false,
"serverSide": true,
processing: false,
serverSide: true,
language: {
zeroRecords: 'Nothing Found In Movies History',
processing: "Loading Movies History..."
},
"searching": false,
"ordering": false,
"responsive": true,
"lengthChange": false,
"pageLength": {{ settings.general.page_size }},
"ajax": "{{ url_for('api.historymovies') }}",
"columns": [
{"data": "action",
"render": function(data) {
searching: false,
ordering: false,
responsive: true,
lengthChange: false,
pageLength: {{ settings.general.page_size }},
ajax: "{{ url_for('api.historymovies') }}",
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) {
@ -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>';
}
},
{"data": "timestamp"},
{"data": null,
"render": function (data) {
{data: "timestamp"},
{
data: null,
render: function (data) {
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;
} else {
@ -73,13 +76,13 @@
]
});
events.on('event', function(event) {
events.on('event', function (event) {
var event_json = JSON.parse(event);
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});
}
});
});
});
</script>
{% endblock tail %}

@ -13,14 +13,14 @@
{% block body %}
<table id="history_series" class="table table-striped" style="width:100%">
<thead>
<tr>
<th>Action</th>
<th>Name</th>
<th>Episode</th>
<th>Episode Title</th>
<th>Date</th>
<th>Description</th>
</tr>
<tr>
<th>Action</th>
<th>Name</th>
<th>Episode</th>
<th>Episode Title</th>
<th>Date</th>
<th>Description</th>
</tr>
</thead>
</table>
{% endblock body %}
@ -29,21 +29,22 @@
<script>
$(document).ready(function () {
var table = $('#history_series').DataTable({
"processing": true,
"serverSide": true,
processing: true,
serverSide: true,
language: {
zeroRecords: 'Nothing Found In Series History',
processing: "Loading Series History..."
},
"searching": false,
"ordering": false,
"lengthChange": false,
"responsive": true,
"pageLength": {{ settings.general.page_size }},
"ajax": "{{ url_for('api.historyseries') }}",
"columns": [
{"data": "action",
"render": function(data) {
searching: false,
ordering: false,
lengthChange: false,
responsive: true,
pageLength: {{ settings.general.page_size }},
ajax: "{{ url_for('api.historyseries') }}",
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) {
@ -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>';
}
},
{"data": "episode_number"},
{"data": "episodeTitle"},
{"data": "timestamp"},
{"data": null,
"render": function (data) {
{data: "episode_number"},
{data: "episodeTitle"},
{data: "timestamp"},
{
data: null,
render: function (data) {
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;
} else {
@ -77,13 +80,13 @@
]
});
events.on('event', function(event) {
events.on('event', function (event) {
var event_json = JSON.parse(event);
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});
}
});
});
});
</script>
{% endblock tail %}

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

@ -4,7 +4,8 @@
{% block bcleft %}
<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 class="align-bottom text-themecolor small text-center">Mass Edit</div>
</button>
@ -56,7 +57,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">
@ -84,7 +86,7 @@
</div>
</div>
<input type="hidden" id="edit_radarrId" name="radarrId" value="" />
<input type="hidden" id="edit_radarrId" name="radarrId" value=""/>
</div>
<div class="modal-footer">
<button type="submit" id="edit_save_button" class="btn btn-info">Save</button>
@ -100,9 +102,9 @@
<script>
$(document).ready(function () {
getLanguages();
getEnabledLanguages();
getEnabledLanguages();
events.on('event', function(event) {
events.on('event', function (event) {
var event_json = JSON.parse(event);
if (event_json.type === 'movie' && event_json.action === 'insert') {
$.ajax({
@ -139,21 +141,21 @@
});
var table = $('#movies').DataTable({
"dom":
dom:
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
"processing": false,
"serverSide": true,
"searching": false,
"ordering": false,
"lengthChange": true,
"responsive": true,
"pageLength": {{ settings.general.page_size }},
"ajax": "{{ url_for('api.movies') }}",
"columns": [
processing: false,
serverSide: true,
searching: false,
ordering: false,
lengthChange: true,
responsive: true,
pageLength: {{ settings.general.page_size }},
ajax: "{{ url_for('api.movies') }}",
columns: [
{
"data": "monitored",
"render": function (data, type, row) {
data: "monitored",
render: function (data, type, row) {
if (data === 'False') {
return '<i class="far fa-bookmark" data-toggle="tooltip" data-placement="right" title="Movie unmonitored in Radarr"></i>';
} else if (data === 'True') {
@ -162,8 +164,8 @@
}
},
{
"data": null,
"render": function (data) {
data: null,
render: function (data) {
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>';
} else {
@ -172,9 +174,9 @@
}
},
{
"data": null,
"className": "dt-center",
"render": function (data) {
data: null,
className: "dt-center",
render: function (data) {
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>';
} else if (data.exist === true) {
@ -182,10 +184,10 @@
}
}
},
{"data": "audio_language.name"},
{data: "audio_language.name"},
{
"data": "languages",
"render": function (data) {
data: "languages",
render: function (data) {
if (data !== 'None') {
var languages = '';
data.forEach(appendFunc);
@ -200,75 +202,75 @@
}
},
{
"data": "hearing_impaired",
"className": "dt-center"
data: "hearing_impaired",
className: "dt-center"
},
{
"data": "forced",
"className": "dt-center"
data: "forced",
className: "dt-center"
},
{
"data": null,
"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>';
data: null,
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>';
}
}
]
});
});
$('#movies').on('click', '.edit_button', function(e){
e.preventDefault();
$("#edit_movies_title_span").html($(this).data('title'));
$("#edit_audio_language_span").html($(this).data('audiolanguage'));
$('#edit_radarrId').val($(this).data('radarrid'));
$('#movies').on('click', '.edit_button', function (e) {
e.preventDefault();
$("#edit_movies_title_span").html($(this).data('title'));
$("#edit_audio_language_span").html($(this).data('audiolanguage'));
$('#edit_radarrId').val($(this).data('radarrid'));
$('#edit_languages_select').empty();
if ('{{settings.general.single_language}}' === 'True') {
$('#edit_languages_select').selectpicker({maxOptions: 1});
}
if ('{{settings.general.single_language}}' === 'True') {
$('#edit_languages_select').empty();
if ('{{settings.general.single_language}}' === 'True') {
$('#edit_languages_select').selectpicker({maxOptions: 1});
}
if ('{{settings.general.single_language}}' === 'True') {
$('#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").selectpicker("refresh");
var selected_languages = Array();
$.each(Array.from($(this).data('languages')), function (i, item) {
selected_languages.push(item.code2);
});
$('#edit_languages_select').selectpicker('val', selected_languages);
$('#hi_checkbox').prop('checked', ($(this).data('hi') === 'True'));
$('#edit_forced_select').val($(this).data('forced')).change();
$('#edit_languages_select').append('<option value="' + item.code2 + '">' + item.name + '</option>');
});
$("#edit_languages_select").selectpicker("refresh");
var selected_languages = Array();
$.each(Array.from($(this).data('languages')), function (i, item) {
selected_languages.push(item.code2);
});
$('#edit_languages_select').selectpicker('val', selected_languages);
$('#hi_checkbox').prop('checked', ($(this).data('hi') === 'True'));
$('#edit_forced_select').val($(this).data('forced')).change();
$('#editModal')
.modal({
focus: false
});
});
$('#editModal')
.modal({
focus: false
});
});
$('#edit_form').on('submit', function(e){
e.preventDefault();
var formdata = new FormData(document.getElementById("edit_form"));
$('#edit_form').on('submit', function (e) {
e.preventDefault();
var formdata = new FormData(document.getElementById("edit_form"));
$.ajax({
url: "{{ url_for('api.movies') }}?radarrid=" + $('#edit_radarrId').val(),
data: formdata,
processData: false,
contentType: false,
type: 'POST',
success: function(){
$('#editModal').modal('hide');
}
});
});
$.ajax({
url: "{{ url_for('api.movies') }}?radarrid=" + $('#edit_radarrId').val(),
data: formdata,
processData: false,
contentType: false,
type: 'POST',
success: function () {
$('#editModal').modal('hide');
}
});
});
function getLanguages() {
$.ajax({
url: "{{ url_for('api.languages') }}?enabled=false",
success:function(data) {
success: function (data) {
availableLanguages = data;
}
});
@ -277,7 +279,7 @@
function getEnabledLanguages() {
$.ajax({
url: "{{ url_for('api.languages') }}?enabled=true",
success:function(data) {
success: function (data) {
enabledLanguages = data;
}
});

@ -63,7 +63,7 @@
getEnabledLanguages();
events.on('event', function(event) {
events.on('event', function (event) {
var event_json = JSON.parse(event);
if (event_json.type === 'movie' && event_json.action === 'insert') {
$.ajax({
@ -106,38 +106,39 @@
$('#save_button').css('cursor', 'not-allowed');
var table = $('#movies').DataTable({
"processing": true,
"serverSide": true,
processing: true,
serverSide: true,
language: {
zeroRecords: 'No Movies Found',
processing: "Loading Movies..."
},
"searching": false,
"ordering": false,
"lengthChange": true,
"responsive": true,
"paging": false,
"ajax": "{{ url_for('api.movies') }}",
"columnDefs": [ {
"orderable": false,
"className": 'select-checkbox',
"targets": 0
} ],
"select": {
"style": 'multi',
"selector": 'td:first-child'
searching: false,
ordering: false,
lengthChange: true,
responsive: true,
paging: false,
ajax: "{{ url_for('api.movies') }}",
columnDefs: [{
orderable: false,
className: 'select-checkbox',
targets: 0
}],
select: {
style: 'multi',
selector: 'td:first-child'
},
"columns": [
{"defaultContent": ""},
{"data": null,
"render": function (data) {
columns: [
{defaultContent: ""},
{
data: null,
render: function (data) {
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",
"render": function (data) {
data: "languages",
render: function (data) {
if (data !== 'None') {
var languages = '';
data.forEach(appendFunc);
@ -152,42 +153,53 @@
}
},
{
"data": "hearing_impaired",
"className": "dt-center"
data: "hearing_impaired",
className: "dt-center"
},
{
"data": "forced",
"className": "dt-center"
data: "forced",
className: "dt-center"
}
]
});
new $.fn.dataTable.Buttons( table, {
"buttons": [
'selectAll',
'selectNone'
]
} );
new $.fn.dataTable.Buttons(table, {
buttons: [
{
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.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').selectpicker('refresh');
$('#save_button').prop('disabled', false);
$('#save_button').removeClass('disabled');
$('#save_button').css('cursor', 'auto');
} );
});
table.on( 'deselect', function () {
if (table.rows( '.selected' ).count() === 0) {
table.on('deselect', function () {
if (table.rows('.selected').count() === 0) {
$('.selectpicker').prop('disabled', true);
$('.selectpicker').selectpicker('refresh');
$('#save_button').prop('disabled', true);
$('#save_button').addClass('disabled');
$('#save_button').css('cursor', 'not-allowed');
}
} );
});
if ('{{settings.general.single_language}}' === 'True') {
$('#languages_select').selectpicker({maxOptions: 1});
@ -195,10 +207,10 @@
$('#hi_select').selectpicker({maxOptions: 1});
$('#forced_select').selectpicker({maxOptions: 1});
$('#save_button').on('click', function(e){
$('#save_button').on('click', function (e) {
e.preventDefault();
const values = {
radarrid: table.rows( { selected: true } ).ids().toArray(),
radarrid: table.rows({selected: true}).ids().toArray(),
languages: $('#languages_select').val(),
hi: $('#hi_select').val(),
forced: $('#forced_select').val()
@ -207,9 +219,9 @@
$.ajax({
url: "{{ url_for('api.movieseditsave') }}",
method: "POST",
data: JSON.stringify(values),
data: JSON.stringify(values),
contentType: 'application/json',
success: function(){
success: function () {
table.rows().deselect();
$('#languages_select').selectpicker('val', '');
$('#hi_select').selectpicker('val', '');
@ -222,10 +234,10 @@
function getEnabledLanguages() {
$.ajax({
url: "{{ url_for('api.languages') }}?enabled=true",
success:function(data) {
success: function (data) {
$('#languages_select').append('<option value="None">None</option>');
$.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");
}

@ -4,7 +4,8 @@
{% block bcleft %}
<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 class="align-bottom text-themecolor small text-center">Mass Edit</div>
</button>
@ -18,16 +19,16 @@
{% block body %}
<table id="series" class="table table-striped" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Path Exist</th>
<th>Audio Language</th>
<th>Subtitles Languages</th>
<th>Hearing-Impaired</th>
<th>Forced</th>
<th>Subtitles</th>
<th></th>
</tr>
<tr>
<th>Name</th>
<th>Path Exist</th>
<th>Audio Language</th>
<th>Subtitles Languages</th>
<th>Hearing-Impaired</th>
<th>Forced</th>
<th>Subtitles</th>
<th></th>
</tr>
</thead>
</table>
@ -56,7 +57,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">
@ -84,7 +86,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>
@ -101,9 +103,9 @@
<script>
$(document).ready(function () {
getLanguages();
getEnabledLanguages();
getEnabledLanguages();
events.on('event', function(event) {
events.on('event', function (event) {
var event_json = JSON.parse(event);
if (event_json.type === 'series' && event_json.action === 'insert') {
$.ajax({
@ -140,29 +142,33 @@
});
var table = $('#series').DataTable({
"processing": true,
"serverSide": true,
dom:
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
processing: true,
serverSide: true,
language: {
zeroRecords: 'No Series Found',
processing: "Loading Series..."
},
"searching": false,
"ordering": false,
"lengthChange": false,
"responsive": true,
"pageLength": {{ settings.general.page_size }},
"ajax": "{{ url_for('api.series') }}",
"columns": [
{"data": null,
"render": function (data) {
searching: false,
ordering: false,
lengthChange: false,
responsive: true,
pageLength: {{ settings.general.page_size }},
ajax: "{{ url_for('api.series') }}",
columns: [
{
data: null,
render: function (data) {
return '<a href="' + "{{ url_for( 'episodes', no='tempvalue' ) }}".replace("tempvalue", data.sonarrSeriesId) + '">' + data.title + '</a>';
}
},
{
"data": null,
"className": "dt-center",
"responsivePriority": 1,
"render": function (data) {
data: null,
className: "dt-center",
responsivePriority: 1,
render: function (data) {
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>';
} else if (data.exist === true) {
@ -170,10 +176,10 @@
}
}
},
{"data": "audio_language.name"},
{data: "audio_language.name"},
{
"data": "languages",
"render": function (data) {
data: "languages",
render: function (data) {
if (data !== 'None') {
var languages = '';
data.forEach(appendFunc);
@ -188,17 +194,17 @@
}
},
{
"data": "hearing_impaired",
"className": "dt-center"
data: "hearing_impaired",
className: "dt-center"
},
{
"data": "forced",
"className": "dt-center"
data: "forced",
className: "dt-center"
},
{
"data": null,
"responsivePriority": 2,
"render": function (data) {
data: null,
responsivePriority: 2,
render: function (data) {
var total = data.episodeFileCount;
var completed = data.episodeFileCount - data.episodeMissingCount;
var completed_style = '';
@ -211,67 +217,67 @@
}
},
{
"data": null,
"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>';
data: null,
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>';
}
}
]
});
});
$('#series').on('click', '.edit_button', function(e){
e.preventDefault();
$("#edit_series_title_span").html($(this).data('title'));
$("#edit_audio_language_span").html($(this).data('audiolanguage'));
$('#edit_sonarrSeriesId').val($(this).data('sonarrseriesid'));
$('#series').on('click', '.edit_button', function (e) {
e.preventDefault();
$("#edit_series_title_span").html($(this).data('title'));
$("#edit_audio_language_span").html($(this).data('audiolanguage'));
$('#edit_sonarrSeriesId').val($(this).data('sonarrseriesid'));
$('#edit_languages_select').empty();
if ('{{settings.general.single_language}}' === 'True') {
$('#edit_languages_select').selectpicker({maxOptions: 1});
}
if ('{{settings.general.single_language}}' === 'True') {
$('#edit_languages_select').empty();
if ('{{settings.general.single_language}}' === 'True') {
$('#edit_languages_select').selectpicker({maxOptions: 1});
}
if ('{{settings.general.single_language}}' === 'True') {
$('#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").selectpicker("refresh");
var selected_languages = Array();
$.each(Array.from($(this).data('languages')), function (i, item) {
selected_languages.push(item.code2);
});
$('#edit_languages_select').selectpicker('val', selected_languages);
$('#hi_checkbox').prop('checked', ($(this).data('hi') === 'True'));
$('#edit_forced_select').val($(this).data('forced')).change();
$('#edit_languages_select').append('<option value="' + item.code2 + '">' + item.name + '</option>');
});
$("#edit_languages_select").selectpicker("refresh");
var selected_languages = Array();
$.each(Array.from($(this).data('languages')), function (i, item) {
selected_languages.push(item.code2);
});
$('#edit_languages_select').selectpicker('val', selected_languages);
$('#hi_checkbox').prop('checked', ($(this).data('hi') === 'True'));
$('#edit_forced_select').val($(this).data('forced')).change();
$('#editModal')
.modal({
focus: false
});
});
$('#editModal')
.modal({
focus: false
});
});
$('#edit_form').on('submit', function(e){
e.preventDefault();
var formdata = new FormData(document.getElementById("edit_form"));
$('#edit_form').on('submit', function (e) {
e.preventDefault();
var formdata = new FormData(document.getElementById("edit_form"));
$.ajax({
url: "{{ url_for('api.series') }}?seriesid=" + $('#edit_sonarrSeriesId').val(),
data: formdata,
processData: false,
contentType: false,
type: 'POST',
success: function(){
$('#editModal').modal('hide');
}
});
});
$.ajax({
url: "{{ url_for('api.series') }}?seriesid=" + $('#edit_sonarrSeriesId').val(),
data: formdata,
processData: false,
contentType: false,
type: 'POST',
success: function () {
$('#editModal').modal('hide');
}
});
});
function getLanguages() {
$.ajax({
url: "{{ url_for('api.languages') }}?enabled=false",
success:function(data) {
success: function (data) {
availableLanguages = data;
}
});
@ -280,7 +286,7 @@
function getEnabledLanguages() {
$.ajax({
url: "{{ url_for('api.languages') }}?enabled=true",
success:function(data) {
success: function (data) {
enabledLanguages = data;
}
});

@ -63,7 +63,7 @@
getEnabledLanguages();
events.on('event', function(event) {
events.on('event', function (event) {
var event_json = JSON.parse(event);
if (event_json.type === 'series' && event_json.action === 'insert') {
$.ajax({
@ -106,38 +106,39 @@
$('#save_button').css('cursor', 'not-allowed');
var table = $('#series').DataTable({
"processing": true,
"serverSide": true,
processing: true,
serverSide: true,
language: {
zeroRecords: 'No Series Found',
processing: "Loading Series..."
},
"searching": false,
"ordering": false,
"lengthChange": true,
"responsive": true,
"paging": false,
"ajax": "{{ url_for('api.series') }}",
"columnDefs": [ {
"orderable": false,
"className": 'select-checkbox',
"targets": 0
} ],
"select": {
"style": 'multi',
"selector": 'td:first-child'
searching: false,
ordering: false,
lengthChange: true,
responsive: true,
paging: false,
ajax: "{{ url_for('api.series') }}",
columnDefs: [{
orderable: false,
className: 'select-checkbox',
targets: 0
}],
select: {
style: 'multi',
selector: 'td:first-child'
},
"columns": [
{"defaultContent": ""},
{"data": null,
"render": function (data) {
columns: [
{defaultContent: ""},
{
data: null,
render: function (data) {
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",
"render": function (data) {
data: "languages",
render: function (data) {
if (data !== 'None') {
var languages = '';
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",
"className": "dt-center"
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>'
},
{
"data": "forced",
"className": "dt-center"
}
]
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>'
}]
});
new $.fn.dataTable.Buttons( table, {
"buttons": [
'selectAll',
'selectNone'
]
} );
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').selectpicker('refresh');
$('#save_button').prop('disabled', false);
$('#save_button').removeClass('disabled');
$('#save_button').css('cursor', 'auto');
} );
});
table.on( 'deselect', function () {
if (table.rows( '.selected' ).count() === 0) {
table.on('deselect', function () {
if (table.rows('.selected').count() === 0) {
$('.selectpicker').prop('disabled', true);
$('.selectpicker').selectpicker('refresh');
$('#save_button').prop('disabled', true);
$('#save_button').addClass('disabled');
$('#save_button').css('cursor', 'not-allowed');
}
} );
});
if ('{{settings.general.single_language}}' === 'True') {
$('#languages_select').selectpicker({maxOptions: 1});
@ -195,10 +201,10 @@
$('#hi_select').selectpicker({maxOptions: 1});
$('#forced_select').selectpicker({maxOptions: 1});
$('#save_button').on('click', function(e){
$('#save_button').on('click', function (e) {
e.preventDefault();
const values = {
seriesid: table.rows( { selected: true } ).ids().toArray(),
seriesid: table.rows({selected: true}).ids().toArray(),
languages: $('#languages_select').val(),
hi: $('#hi_select').val(),
forced: $('#forced_select').val()
@ -207,9 +213,9 @@
$.ajax({
url: "{{ url_for('api.serieseditsave') }}",
method: "POST",
data: JSON.stringify(values),
data: JSON.stringify(values),
contentType: 'application/json',
success: function(){
success: function () {
table.rows().deselect();
$('#languages_select').selectpicker('val', '');
$('#hi_select').selectpicker('val', '');
@ -222,10 +228,10 @@
function getEnabledLanguages() {
$.ajax({
url: "{{ url_for('api.languages') }}?enabled=true",
success:function(data) {
success: function (data) {
$('#languages_select').append('<option value="None">None</option>');
$.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");
}

@ -4,9 +4,9 @@
{% block bcleft %}
<button class="btn btn-outline" id="search_button">
<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 All</div>
</button>
<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 All</div>
</button>
{% endblock bcleft %}
{% block bcright %}
@ -16,10 +16,10 @@
{% block body %}
<table id="wanted_movies" class="table table-striped" style="width:100%">
<thead>
<tr>
<th>Movies</th>
<th>Missing Subtitle(s)</th>
</tr>
<tr>
<th>Movies</th>
<th>Missing Subtitle(s)</th>
</tr>
</thead>
</table>
{% endblock body %}
@ -28,26 +28,28 @@
<script>
$(document).ready(function () {
var table = $('#wanted_movies').DataTable({
"processing": true,
"serverSide": true,
processing: true,
serverSide: true,
language: {
zeroRecords: 'No Missing Movies Subtitles',
processing: "Loading Missing Movies Subtitles..."
},
"searching": false,
"ordering": false,
"lengthChange": false,
"responsive": true,
"pageLength": {{ settings.general.page_size }},
"ajax": "{{ url_for('api.wantedmovies') }}",
"columns": [
{"data": null,
"render": function (data) {
searching: false,
ordering: false,
lengthChange: false,
responsive: true,
pageLength: {{ settings.general.page_size }},
ajax: "{{ url_for('api.wantedmovies') }}",
columns: [
{
data: null,
render: function (data) {
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') {
var languages = '';
data.missing_subtitles.forEach(appendFunc);
@ -57,28 +59,28 @@
}
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();
$.ajax({
url: "{{ url_for('api.searchwantedmovies') }}",
type: 'GET',
beforeSend: function() {
beforeSend: function () {
$('#search_button').find("i").addClass('fa-spin');
},
complete: function() {
complete: function () {
$('#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');
e.preventDefault();
const values = {
@ -96,19 +98,19 @@
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>');
}
});
});
events.on('event', function(event) {
events.on('event', function (event) {
var event_json = JSON.parse(event);
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});
}
});
});
});
</script>
{% endblock tail %}

@ -4,9 +4,9 @@
{% block bcleft %}
<button class="btn btn-outline" id="search_button">
<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 All</div>
</button>
<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 All</div>
</button>
{% endblock bcleft %}
{% block bcright %}
@ -16,12 +16,12 @@
{% block body %}
<table id="wanted_series" class="table table-striped" style="width:100%">
<thead>
<tr>
<th>Series</th>
<th>Episode</th>
<th>Episode Title</th>
<th>Missing Subtitle(s)</th>
</tr>
<tr>
<th>Series</th>
<th>Episode</th>
<th>Episode Title</th>
<th>Missing Subtitle(s)</th>
</tr>
</thead>
</table>
{% endblock body %}
@ -30,28 +30,30 @@
<script>
$(document).ready(function () {
var table = $('#wanted_series').DataTable({
"processing": true,
"serverSide": true,
processing: true,
serverSide: true,
language: {
zeroRecords: 'No Missing Series Subtitles',
processing: "Loading Missing Series Subtitles..."
},
"searching": false,
"ordering": false,
"lengthChange": false,
"responsive": true,
"pageLength": {{ settings.general.page_size }},
"ajax": "{{ url_for('api.wantedseries') }}",
"columns": [
{"data": null,
"render": function (data) {
searching: false,
ordering: false,
lengthChange: false,
responsive: true,
pageLength: {{ settings.general.page_size }},
ajax: "{{ url_for('api.wantedseries') }}",
columns: [
{
data: null,
render: function (data) {
return '<a href="' + "{{ url_for( 'episodes', no='tempvalue' ) }}".replace("tempvalue", data.sonarrSeriesId) + '">' + data.seriesTitle + '</a>';
}
},
{"data": "episode_number"},
{"data": "episodeTitle"},
{"data": null,
"render": function (data) {
{data: "episode_number"},
{data: "episodeTitle"},
{
data: null,
render: function (data) {
if (data.missing_subtitles !== 'None') {
var languages = '';
data.missing_subtitles.forEach(appendFunc);
@ -61,28 +63,28 @@
}
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();
$.ajax({
url: "{{ url_for('api.searchwantedseries') }}",
type: 'GET',
beforeSend: function() {
beforeSend: function () {
$('#search_button').find("i").addClass('fa-spin');
},
complete: function() {
complete: function () {
$('#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');
e.preventDefault();
const values = {
@ -101,19 +103,19 @@
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>');
}
});
});
events.on('event', function(event) {
events.on('event', function (event) {
var event_json = JSON.parse(event);
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});
}
});
});
});
</script>
{% endblock tail %}

Loading…
Cancel
Save