mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-04-24 22:57:13 -04:00
WIP
This commit is contained in:
parent
db88156dc1
commit
d91f68f163
4 changed files with 95 additions and 13 deletions
|
@ -77,12 +77,12 @@ class Series(Resource):
|
||||||
# Add missing subtitles episode count
|
# Add missing subtitles episode count
|
||||||
item.update({"episodeMissingCount": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE "
|
item.update({"episodeMissingCount": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE "
|
||||||
"sonarrSeriesId=? AND missing_subtitles is not null "
|
"sonarrSeriesId=? AND missing_subtitles is not null "
|
||||||
"AND missing_subtitles != '[]'", (seriesId,),
|
"AND missing_subtitles != '[]'",
|
||||||
only_one=True)['count']})
|
(item['sonarrSeriesId'],), only_one=True)['count']})
|
||||||
|
|
||||||
# Add episode count
|
# Add episode count
|
||||||
item.update({"episodeFileCount": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE "
|
item.update({"episodeFileCount": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE "
|
||||||
"sonarrSeriesId=?", (seriesId,),
|
"sonarrSeriesId=?", (item['sonarrSeriesId'],),
|
||||||
only_one=True)['count']})
|
only_one=True)['count']})
|
||||||
return jsonify(draw=draw, recordsTotal=row_count, recordsFiltered=row_count, data=result)
|
return jsonify(draw=draw, recordsTotal=row_count, recordsFiltered=row_count, data=result)
|
||||||
|
|
||||||
|
|
|
@ -461,6 +461,14 @@
|
||||||
clearTimeout(notificationTimeout);
|
clearTimeout(notificationTimeout);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
$('[data-toggle="tooltip"]').tooltip()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
{% endblock tail_js %}
|
{% endblock tail_js %}
|
||||||
{% block tail %}
|
{% block tail %}
|
||||||
{% endblock tail %}
|
{% endblock tail %}
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
<table id="movies" class="mdl-data-table" style="width:100%">
|
<table id="movies" class="mdl-data-table" style="width:100%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Monitored</th>
|
<th></th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Path exist</th>
|
<th>Exist</th>
|
||||||
<th>Audio Language</th>
|
<th>Audio Language</th>
|
||||||
<th>Subtitles Languages</th>
|
<th>Subtitles Languages</th>
|
||||||
<th>Hearing-Impaired</th>
|
<th>Hearing-Impaired</th>
|
||||||
|
@ -33,11 +33,49 @@
|
||||||
"lengthChange": false,
|
"lengthChange": false,
|
||||||
"ajax": "/api/movies",
|
"ajax": "/api/movies",
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "data": "monitored" },
|
{ "data": "monitored",
|
||||||
{ "data": "title" },
|
"render": function ( data, type, row ) {
|
||||||
{ "data": "exist" },
|
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') {
|
||||||
|
return '<i class="fas fa-bookmark" data-toggle="tooltip" data-placement="right" title="Movie monitored in Radarr"></i>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "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> ' + data.title;
|
||||||
|
} else {
|
||||||
|
return data.title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ "data": "exist",
|
||||||
|
"render": function ( data ) {
|
||||||
|
if (data === false) {
|
||||||
|
return '<i class="fas fa-exclamation-triangle" data-toggle="tooltip" data-placement="right" title="This path doesn\'t seem to be valid."></i>';
|
||||||
|
} else if (data === true) {
|
||||||
|
return '<i class="fas fa-check" data-toggle="tooltip" data-placement="right" title="This path seems to be valid."></i>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{ "data": "audio_language.name" },
|
{ "data": "audio_language.name" },
|
||||||
{ "data": "languages[, ].code2" },
|
{ "data": "languages",
|
||||||
|
"render": function ( data ) {
|
||||||
|
if (data !== 'None') {
|
||||||
|
var languages = '';
|
||||||
|
data.forEach(appendFunc);
|
||||||
|
return languages;
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
function appendFunc(value) {
|
||||||
|
languages = languages + '<span class="badge badge-secondary" data-toggle="tooltip" data-placement="right" title="'+value.name+'">'+value.code2+'</span> ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{ "data": "hearing_impaired" },
|
{ "data": "hearing_impaired" },
|
||||||
{ "data": "forced" }
|
{ "data": "forced" }
|
||||||
]
|
]
|
||||||
|
|
|
@ -11,11 +11,12 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Path exist</th>
|
<th>Exist</th>
|
||||||
<th>Audio Language</th>
|
<th>Audio Language</th>
|
||||||
<th>Subtitles Languages</th>
|
<th>Subtitles Languages</th>
|
||||||
<th>Hearing-Impaired</th>
|
<th>Hearing-Impaired</th>
|
||||||
<th>Forced</th>
|
<th>Forced</th>
|
||||||
|
<th>Subtitles</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
|
@ -33,11 +34,46 @@
|
||||||
"ajax": "/api/series",
|
"ajax": "/api/series",
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "data": "title" },
|
{ "data": "title" },
|
||||||
{ "data": "exist" },
|
{ "data": "exist",
|
||||||
|
"render": function ( data ) {
|
||||||
|
if (data === false) {
|
||||||
|
return '<i class="fas fa-exclamation-triangle" data-toggle="tooltip" data-placement="right" title="This path doesn\'t seem to be valid."></i>';
|
||||||
|
} else if (data === true) {
|
||||||
|
return '<i class="fas fa-check" data-toggle="tooltip" data-placement="right" title="This path seems to be valid."></i>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{ "data": "audio_language.name" },
|
{ "data": "audio_language.name" },
|
||||||
{ "data": "languages[, ].code2" },
|
{ "data": "languages",
|
||||||
|
"render": function ( data ) {
|
||||||
|
if (data !== 'None') {
|
||||||
|
var languages = '';
|
||||||
|
data.forEach(appendFunc);
|
||||||
|
return languages;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function appendFunc(value) {
|
||||||
|
languages = languages + '<span class="badge badge-secondary" data-toggle="tooltip" data-placement="right" title="'+value.name+'">'+value.code2+'</span> ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{ "data": "hearing_impaired" },
|
{ "data": "hearing_impaired" },
|
||||||
{ "data": "forced" }
|
{ "data": "forced" },
|
||||||
|
{ "data": null,
|
||||||
|
"render": function ( data ) {
|
||||||
|
var total = data.episodeFileCount;
|
||||||
|
var completed = data.episodeFileCount - data.episodeMissingCount;
|
||||||
|
var completed_style = '';
|
||||||
|
var completed_text = '';
|
||||||
|
if (completed/total*100 > 0 && data.languages !== 'None') {
|
||||||
|
completed_style = ' style="width: '+completed/total*100+'%;"';
|
||||||
|
completed_text = completed+'/'+total;
|
||||||
|
}
|
||||||
|
return '<div class="progress"><div class="progress-bar" role="progressbar"'+completed_style+' aria-valuenow="'+completed+'" aria-valuemin="0" aria-valuemax="'+total+'">'+completed_text+'</div></div>'
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue