diff --git a/views/wantedmovies.html b/views/wantedmovies.html
index 122539ef8..8e5603f1b 100644
--- a/views/wantedmovies.html
+++ b/views/wantedmovies.html
@@ -43,10 +43,48 @@
return '' + data.title + '';
}
},
- {"data": "missing_subtitles"}
+ {"data": null,
+ "render": function (data) {
+ if (data.missing_subtitles !== 'None') {
+ var languages = '';
+ data.missing_subtitles.forEach(appendFunc);
+ return languages;
+ } else {
+ return null;
+ }
+
+ function appendFunc(value) {
+ languages = languages + '' + value.code2 + ((value.forced) ? ':forced':'') + ' ';
+ }
+ }
+ }
]
});
+ $('#wanted_movies').on('click', '.get_subtitle', function(e){
+ $(this).tooltip('dispose');
+ e.preventDefault();
+ const values = {
+ moviePath: $(this).attr("data-moviepath"),
+ sceneName: $(this).attr("data-scenename"),
+ language: $(this).attr("data-language"),
+ hi: $(this).attr("data-hi"),
+ forced: $(this).attr("data-forced"),
+ radarrId: $(this).attr("data-radarrid"),
+ title: $(this).attr("data-movietitle")
+ };
+ var cell = $(this).parent();
+ $.ajax({
+ url: "{{ url_for('api.moviesubtitlesdownload') }}",
+ type: "POST",
+ dataType: "json",
+ data: values,
+ beforeSend: function() {
+ cell.html('
Loading...
');
+ }
+ });
+ });
+
events.on('event', function(event) {
var event_json = JSON.parse(event);
if (event_json.type === 'movie') {
diff --git a/views/wantedseries.html b/views/wantedseries.html
index ba2b2ad1e..433e0c5e7 100644
--- a/views/wantedseries.html
+++ b/views/wantedseries.html
@@ -47,13 +47,52 @@
},
{"data": "episode_number"},
{"data": "episodeTitle"},
- {"data": "missing_subtitles"}
+ {"data": null,
+ "render": function (data) {
+ if (data.missing_subtitles !== 'None') {
+ var languages = '';
+ data.missing_subtitles.forEach(appendFunc);
+ return languages;
+ } else {
+ return null;
+ }
+
+ function appendFunc(value) {
+ languages = languages + '' + value.code2 + ((value.forced) ? ':forced':'') + ' ';
+ }
+ }
+ }
]
});
+ $('#wanted_series').on('click', '.get_subtitle', function(e){
+ $(this).tooltip('dispose');
+ e.preventDefault();
+ const values = {
+ episodePath: $(this).attr("data-episodepath"),
+ sceneName: $(this).attr("data-scenename"),
+ language: $(this).attr("data-language"),
+ hi: $(this).attr("data-hi"),
+ forced: $(this).attr("data-forced"),
+ sonarrSeriesId: $(this).attr("data-sonarrseriesid"),
+ sonarrEpisodeId: $(this).attr('data-sonarrepisodeid'),
+ title: $(this).attr("data-seriestitle")
+ };
+ var cell = $(this).parent();
+ $.ajax({
+ url: "{{ url_for('api.episodessubtitlesdownload') }}",
+ type: "POST",
+ dataType: "json",
+ data: values,
+ beforeSend: function() {
+ cell.html('Loading...
');
+ }
+ });
+ });
+
events.on('event', function(event) {
var event_json = JSON.parse(event);
- if (event_json.type === 'episodes') {
+ if (event_json.type === 'episode') {
$('#wanted_series').DataTable().ajax.reload(resetPaging=false);
$('[data-toggle="tooltip"]').tooltip({html: true});
}