mirror of
https://github.com/morpheus65535/bazarr.git
synced 2024-11-10 17:13:35 +08: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
|
||||
item.update({"episodeMissingCount": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE "
|
||||
"sonarrSeriesId=? AND missing_subtitles is not null "
|
||||
"AND missing_subtitles != '[]'", (seriesId,),
|
||||
only_one=True)['count']})
|
||||
"AND missing_subtitles != '[]'",
|
||||
(item['sonarrSeriesId'],), only_one=True)['count']})
|
||||
|
||||
# Add episode count
|
||||
item.update({"episodeFileCount": database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE "
|
||||
"sonarrSeriesId=?", (seriesId,),
|
||||
"sonarrSeriesId=?", (item['sonarrSeriesId'],),
|
||||
only_one=True)['count']})
|
||||
return jsonify(draw=draw, recordsTotal=row_count, recordsFiltered=row_count, data=result)
|
||||
|
||||
|
|
|
@ -461,6 +461,14 @@
|
|||
clearTimeout(notificationTimeout);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
})
|
||||
</script>
|
||||
{% endblock tail_js %}
|
||||
{% block tail %}
|
||||
{% endblock tail %}
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
<table id="movies" class="mdl-data-table" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Monitored</th>
|
||||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>Path exist</th>
|
||||
<th>Exist</th>
|
||||
<th>Audio Language</th>
|
||||
<th>Subtitles Languages</th>
|
||||
<th>Hearing-Impaired</th>
|
||||
|
@ -33,11 +33,49 @@
|
|||
"lengthChange": false,
|
||||
"ajax": "/api/movies",
|
||||
"columns": [
|
||||
{ "data": "monitored" },
|
||||
{ "data": "title" },
|
||||
{ "data": "exist" },
|
||||
{ "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') {
|
||||
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": "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": "forced" }
|
||||
]
|
||||
|
|
|
@ -11,11 +11,12 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Path exist</th>
|
||||
<th>Exist</th>
|
||||
<th>Audio Language</th>
|
||||
<th>Subtitles Languages</th>
|
||||
<th>Hearing-Impaired</th>
|
||||
<th>Forced</th>
|
||||
<th>Subtitles</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
@ -33,11 +34,46 @@
|
|||
"ajax": "/api/series",
|
||||
"columns": [
|
||||
{ "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": "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": "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…
Reference in a new issue