add subtitle uploader as a column in manual search dialog

pull/876/head
josdion 5 years ago
parent e09d84e09c
commit dd4707176a

@ -356,6 +356,11 @@ def manual_search(path, language, hi, forced, providers, providers_auth, sceneNa
if len(releases) == 0:
releases = ['n/a']
if s.uploader and s.uploader.strip():
s_uploader = s.uploader.strip()
else:
s_uploader = 'n/a'
subtitles_list.append(
dict(score=round((score / max_score * 100), 2),
orig_score=score,
@ -364,7 +369,7 @@ def manual_search(path, language, hi, forced, providers, providers_auth, sceneNa
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),
release_info=releases))
release_info=releases, uploader=s_uploader))
final_subtitles = sorted(subtitles_list, key=lambda x: (x['orig_score'], x['score_without_hash']),
reverse=True)

@ -416,11 +416,11 @@
<thead>
<tr>
<th style="text-align: left;">Score:</th>
<th style="text-align: left;">Lang.:</th>
<th style="text-align: left;">HI:</th>
<th style="text-align: left;"></th>
<th style="text-align: left;">Provider:</th>
<th style="text-align: left;">Matching:</th>
<th style="text-align: left;">Releases:</th>
<th style="text-align: left;">Uploader:</th>
<th></th>
</tr>
</thead>
@ -694,14 +694,19 @@
},
{ data: null,
render: function ( data, type, row ) {
let lng = data.language;
if ( data.language === "pt" && is_pb === true && is_pt === false) {
return 'pb'
} else {
return data.language
lng = 'pb'
}
let text = '<div class="ui tiny label" style="margin-bottom: 2px;">' + lng.toUpperCase() + '</div>';
if (data.hearing_impaired == "True") {
text += '<div class="ui tiny inverted label" style="background-color: #313335;">HI</div>';
}
return text;
}
},
{ data: 'hearing_impaired' },
{ data: null,
render: function ( data, type, row ) {
return '<a href="'+data.url+'" target="_blank">'+data.provider+'</a>';
@ -740,6 +745,11 @@
}
text += '</div></div>';
return text;
}
},
{ data: 'uploader',
render: function ( data, type, row ) {
return '<div class="ui tiny label">' + data + '</div>';
}
},
{ data: null,

@ -372,12 +372,12 @@
<thead>
<tr>
<th style="text-align: left;">Score:</th>
<th style="text-align: left;">Lang.:</th>
<th style="text-align: left;">HI:</th>
<th style="text-align: left;"></th>
<th style="text-align: left;">Provider:</th>
<th style="text-align: left;">Matching:</th>
<th style="text-align: left;">Releases:</th>
<th></th>details
<th style="text-align: left;">Uploader:</th>
<th></th>
</tr>
</thead>
</table>
@ -632,16 +632,21 @@
},
{ data: null,
render: function ( data, type, row ) {
let lng = data.language;
if ( data.language === "pt" && is_pb === true && is_pt === false) {
return 'pb'
lng = 'pb'
} else if ( data.language === "pt:forced" && is_pb === true && is_pt === false) {
return 'pb:forced'
} else {
return data.language
lng = 'pb:forced'
}
let text = '<div class="ui tiny label" style="margin-bottom: 2px;">' + lng.toUpperCase() + '</div>';
if (data.hearing_impaired == "True") {
text += '<div class="ui tiny inverted label" style="background-color: #313335;">HI</div>';
}
return text;
}
},
{ data: 'hearing_impaired' },
{ data: null,
render: function ( data, type, row ) {
return '<a href="'+data.url+'" target="_blank">'+data.provider+'</a>';
@ -680,6 +685,11 @@
}
text += '</div></div>';
return text;
}
},
{ data: 'uploader',
render: function ( data, type, row ) {
return '<div class="ui tiny label">' + data + '</div>';
}
},
{ data: null,

Loading…
Cancel
Save