diff --git a/views/episodes.html b/views/episodes.html index fe0f7b6c8..c1832b8bf 100644 --- a/views/episodes.html +++ b/views/episodes.html @@ -263,6 +263,37 @@ + + {% endblock body %} {% block tail %} @@ -308,7 +339,11 @@ } }, {"data": "episode"}, - {"data": "title"}, + {"data": null, + "render": function (data) { + return ''+data.title+''; + } + }, {"data": null, "render": function (data) { if (data.subtitles !== null) { @@ -705,6 +740,43 @@ } } }); + + $('.episode_history').on('click', function(e){ + e.preventDefault(); + + $("#episode_history_title_span").html(seriesDetails['title'] + ' - ' + $(this).data("season") + 'x' + $(this).data("episode") + ' - ' + $(this).data("episode_title")); + + sonarrEpisodeId = $(this).data("sonarrEpisodeId"); + + $('#episode_result').DataTable( { + destroy: true, + language: { + zeroRecords: 'No History Records Found For This Episode' + }, + paging: true, + lengthChange: false, + pageLength: 5, + searching: true, + ordering: true, + processing: false, + serverSide: false, + ajax: { + url: '/bazarr-dev/episode_history/' + sonarrEpisodeId + }, + columns: [ + { data: 'action'}, + { data: 'language' }, + { data: 'provider' }, + { data: 'score'}, + { data: 'timestamp' } + ] + } ); + + $('#episodeHistoryModal ') + .modal({ + focus: false + }); + }); }); function seriesDetailsRefresh() {