1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-25 01:02:19 +00:00

Improvement to the manual search modal to show file path, scenename and subtitles matching releases.

This commit is contained in:
Louis Vézina 2019-09-30 23:29:08 -04:00
parent 0f4b9aac82
commit 0bb2c2dd87
3 changed files with 44 additions and 7 deletions

View file

@ -371,7 +371,8 @@ def manual_search(path, language, hi, forced, providers, providers_auth, sceneNa
language=str(s.language), hearing_impaired=str(s.hearing_impaired),
provider=s.provider_name,
subtitle=codecs.encode(pickle.dumps(s.make_picklable()), "base64").decode(),
url=s.page_link, matches=list(matches), dont_matches=list(not_matched)))
url=s.page_link, matches=list(matches), dont_matches=list(not_matched),
release_info=s.release_info.split(',') if hasattr(s, 'release_info') else 'n/a'))
final_subtitles = sorted(subtitles_list, key=lambda x: x['score'], reverse=True)
logging.debug('BAZARR ' + str(len(final_subtitles)) + " Subtitles have been found for this file: " + path)

View file

@ -383,16 +383,19 @@
<i class="close icon"></i>
<div class="header">
<span id="series_title_span"></span> - <span id="season"></span>x<span id="episode"></span> - <span id="episode_title"></span>
<br><div class="ui tiny inverted label" style="background-color: #35c5f4;"><span id="episode_path_span"></span></div>
<br><div class="ui tiny inverted label" style="background-color: orange;"><span id="episode_scenename_span"></span></div>
</div>
<div class="scrolling content">
<table id="search_result" class="display" style="width:100%">
<thead>
<tr>
<th style="text-align: left;">Score:</th>
<th style="text-align: left;">Language:</th>
<th style="text-align: left;">Hearing-Impaired:</th>
<th style="text-align: left;">Lang.:</th>
<th style="text-align: left;">HI:</th>
<th style="text-align: left;">Provider:</th>
<th style="text-align: left;">Based On:</th>
<th style="text-align: left;">Matching:</th>
<th style="text-align: left;">Filename:</th>
<th></th>
</tr>
</thead>
@ -566,6 +569,8 @@
$("#season").html($(this).data("season"));
$("#episode").html($(this).data("episode"));
$("#episode_title").html($(this).data("episode_title"));
$("#episode_path_span").html($(this).attr("data-episodePath"));
$("#episode_scenename_span").html($(this).attr("data-sceneName"));
episodePath = $(this).attr("data-episodePath");
sceneName = $(this).attr("data-sceneName");
@ -609,6 +614,7 @@
},
drawCallback: function(settings) {
$('.inline.dropdown').dropdown();
$('.ui.accordion').accordion();
},
columns: [
{ data: 'score',
@ -655,6 +661,18 @@
},
{ data: null,
render: function ( data, type, row ) {
const array_release_info = data.release_info;
let i;
let text = '<div class="ui fluid accordion"><div class="title"><i class="dropdown icon"></i>...</div><div class="content">';
for (i = 0; i < array_release_info.length; i++) {
text += '<div class="ui tiny label" style="margin-bottom: 2px;">' + array_release_info[i] + '</div>';
}
text += '</div></div>';
return text;
}
},
{ data: null,
render: function ( data, type, row ) {
return '<a href="#" class="ui tiny label" onclick="manual_get(this, episodePath, sceneName, hi, sonarrSeriesId, sonarrEpisodeId)" data-subtitle="'+data.subtitle+'" data-provider="'+data.provider+'" data-language="'+data.language+'"><i class="ui download icon" style="margin-right:0px" ></i></a>';
}
}

View file

@ -335,16 +335,19 @@
<i class="close icon"></i>
<div class="header">
<span id="movie_title_span"></span>
<br><div class="ui tiny inverted label" style="background-color: #35c5f4;"><span id="movie_path_span"></span></div>
<br><div class="ui tiny inverted label" style="background-color: orange;"><span id="movie_scenename_span"></span></div>
</div>
<div class="scrolling content">
<table id="search_result" class="display" style="width:100%">
<thead>
<tr>
<th style="text-align: left;">Score:</th>
<th style="text-align: left;">Language:</th>
<th style="text-align: left;">Hearing-Impaired:</th>
<th style="text-align: left;">Lang.:</th>
<th style="text-align: left;">HI:</th>
<th style="text-align: left;">Provider:</th>
<th style="text-align: left;">Based On:</th>
<th style="text-align: left;">Matching:</th>
<th style="text-align: left;">Subtitles filename:</th>
<th></th>
</tr>
</thead>
@ -513,6 +516,8 @@
$('.manual_search').on('click', function(){
$("#movie_title_span").html($(this).data("movie_title"));
$("#movie_path_span").html($(this).attr("data-moviePath"));
$("#movie_scenename_span").html($(this).attr("data-sceneName"));
moviePath = $(this).attr("data-moviePath");
sceneName = $(this).attr("data-sceneName");
@ -554,6 +559,7 @@
},
drawCallback: function(settings) {
$('.inline.dropdown').dropdown();
$('.ui.accordion').accordion();
},
columns: [
{ data: 'score',
@ -602,6 +608,18 @@
},
{ data: null,
render: function ( data, type, row ) {
const array_release_info = data.release_info;
let i;
let text = '<div class="ui fluid accordion"><div class="title"><i class="dropdown icon"></i>...</div><div class="content">';
for (i = 0; i < array_release_info.length; i++) {
text += '<div class="ui tiny label" style="margin-bottom: 2px;">' + array_release_info[i] + '</div>';
}
text += '</div></div>';
return text;
}
},
{ data: null,
render: function ( data, type, row ) {
return '<a href="#" class="ui tiny label" onclick="manual_get(this, moviePath, sceneName, hi, radarrId)" data-subtitle="'+data.subtitle+'" data-provider="'+data.provider+'" data-language="'+data.language+'"><i class="ui download icon" style="margin-right:0px" ></i></a>';
}
}