2019-04-20 21:15:00 +00:00
< ! DOCTYPE html >
2018-12-09 20:23:51 +00:00
< html lang = " en " >
2018-04-19 23:45:10 +00:00
< head >
< script src = " {{ base_url}}static/jquery/jquery-latest.min.js " > < / script >
< script src = " {{ base_url}}static/semantic/semantic.min.js " > < / script >
< script src = " {{ base_url}}static/jquery/tablesort.js " > < / script >
2018-09-10 21:10:33 +00:00
< script src = " {{ base_url}}static/datatables/jquery.dataTables.min.js " > < / script >
< script src = " {{ base_url}}static/datatables/dataTables.semanticui.min.js " > < / script >
< link rel = " stylesheet " href = " {{ base_url}}static/semantic/semantic.css " >
< link rel = " stylesheet " type = " text/css " href = " {{ base_url}}static/datatables/datatables.min.css " / >
< link rel = " stylesheet " type = " text/css " href = " {{ base_url}}static/datatables/semanticui.min.css " / >
2018-04-19 23:45:10 +00:00
< link rel = " apple-touch-icon " sizes = " 120x120 " href = " {{ base_url}}static/apple-touch-icon.png " >
< link rel = " icon " type = " image/png " sizes = " 32x32 " href = " {{ base_url}}static/favicon-32x32.png " >
< link rel = " icon " type = " image/png " sizes = " 16x16 " href = " {{ base_url}}static/favicon-16x16.png " >
< link rel = " manifest " href = " {{ base_url}}static/manifest.json " >
< link rel = " mask-icon " href = " {{ base_url}}static/safari-pinned-tab.svg " color = " #5bbad5 " >
< link rel = " shortcut icon " href = " {{ base_url}}static/favicon.ico " >
< meta name = " msapplication-config " content = " {{ base_url}}static/browserconfig.xml " >
< meta name = " theme-color " content = " #ffffff " >
< title > { { details [ 0 ] } } - Bazarr < / title >
< style >
body {
background - color : #1b1c1d;
2018-04-24 14:48:52 +00:00
background - image : url ( " {{ base_url}}image_proxy_movies {{ details[3]}} " ) ;
2018-04-19 23:45:10 +00:00
background - repeat : no - repeat ;
background - attachment : fixed ;
background - size : cover ;
background - position : center center ;
}
#divdetails {
2018-09-26 10:35:46 +00:00
background - color : rgba ( 0 , 0 , 0 , 0.9 ) ;
2018-04-19 23:45:10 +00:00
color : #ffffff;
margin - top : 6 em ;
margin - bottom : 3 em ;
padding : 2 em ;
border - radius : 1 px ;
2018-12-09 20:23:51 +00:00
box - shadow : 0 0 5 px 5 px #000000;
2018-04-19 23:45:10 +00:00
min - height : calc ( 250 px + 4 em ) ;
}
#fondblanc {
background - color : #ffffff;
opacity : 0.9 ;
border - radius : 1 px ;
2018-12-09 20:23:51 +00:00
box - shadow : 0 0 3 px 3 px #ffffff;
2018-04-19 23:45:10 +00:00
margin - top : 32 px ;
margin - bottom : 3 em ;
padding - top : 2 em ;
padding - left : 2 em ;
padding - right : 2 em ;
padding - bottom : 1 em ;
2018-05-02 10:25:42 +00:00
text - color : black ;
2018-10-12 17:01:32 +00:00
overflow - x : auto ;
2018-04-19 23:45:10 +00:00
}
. ui . basic . button : hover , . ui . basic . buttons . button : hover {
background : transparent ! important ;
}
. ui . basic . button : active , . ui . basic . buttons . button : active {
background : transparent ! important ;
}
. ui . basic . button : focus , . ui . basic . buttons . button : focus {
background : transparent ! important ;
}
. ui . basic . button : visited , . ui . basic . buttons . button : visited {
background : transparent ! important ;
}
2018-09-10 21:10:33 +00:00
. criteria_matched {
background - color : #e6ffe6 !important;
line - height : 0 ! important ;
}
. criteria_not_matched {
background - color : #ffcccc !important;
line - height : 0 ! important ;
}
2018-04-19 23:45:10 +00:00
< / style >
< / head >
< body >
% import ast
2018-07-30 00:42:24 +00:00
% from get_languages import *
2018-12-15 00:36:28 +00:00
% from config import settings
2018-12-15 00:53:24 +00:00
% from helper import path_replace_movie
2018-12-27 19:19:59 +00:00
% single_language = settings . general . getboolean ( ' single_language ' )
2018-04-24 14:48:52 +00:00
< div style = " display: none; " > < img src = " {{ base_url}}image_proxy_movies {{ details[3]}} " > < / div >
2018-04-19 23:45:10 +00:00
< div id = ' loader ' class = " ui page dimmer " >
2018-09-10 21:10:33 +00:00
< div id = " loader_text " class = " ui indeterminate text loader " > Loading . . . < / div >
2018-04-19 23:45:10 +00:00
< / div >
% include ( ' menu.tpl ' )
2018-04-24 14:48:52 +00:00
< div style = ' padding-left: 2em; padding-right: 2em; ' class = ' ui container ' >
2018-04-19 23:45:10 +00:00
< div id = " divdetails " class = " ui container " >
2019-04-20 21:15:00 +00:00
< div class = " ui stackable grid " >
< div class = " three wide column " >
< img class = " left floated ui image " style = " max-height:250px; " src = " {{ base_url}}image_proxy_movies {{ details[2]}} " >
< / div >
< div class = " thirteen wide column " >
< div class = " ui stackable grid " >
< div class = " ui row " >
< div class = " twelve wide left aligned column " >
< h2 >
% if details [ 13 ] == ' True ' :
< span data - tooltip = " Movie monitored in Radarr " > < i class = " bookmark icon " > < / i > < / span >
% else :
< span data - tooltip = " Movie unmonitored in Radarr " > < i class = " bookmark outline icon " > < / i > < / span >
% end
{ { details [ 0 ] } }
< / h2 >
< / div >
< div class = " four wide right aligned column " >
< div class = " ui right floated basic icon buttons " >
< button id = " scan_disk " class = " ui button " data - tooltip = " Scan disk for subtitles " data - inverted = " " > < i class = " ui inverted large compact refresh icon " > < / i > < / button >
< button id = " search_missing_subtitles_movie " class = " ui button " data - tooltip = " Download missing subtitles " data - inverted = " " > < i class = " ui inverted huge compact search icon " > < / i > < / button >
< %
subs_languages = ast . literal_eval ( str ( details [ 7 ] ) )
subs_languages_list = [ ]
if subs_languages is not None :
for subs_language in subs_languages :
subs_languages_list . append ( subs_language )
end
end
% >
% if subs_languages is not None :
2019-04-26 02:18:13 +00:00
< button class = " manual_search ui button " data - tooltip = " Manually search for subtitles " data - inverted = " " data - moviePath = " {{ details[8]}} " data - scenename = " {{ details[12]}} " data - language = " {{ subs_languages_list}} " data - hi = " {{ details[4]}} " data - forced = " {{ details[15]}} " data - movie_title = " {{ details[0]}} " data - radarrId = " {{ details[10]}} " > < i class = " ui inverted large compact user icon " > < / i > < / button >
2019-04-20 21:15:00 +00:00
% end
2019-05-22 03:33:59 +00:00
< button id = " config " class = " ui button " data - tooltip = " Edit movie " data - inverted = " " data - tmdbid = " {{ details[5]}} " data - title = " {{ details[0]}} " data - poster = " {{ details[2]}} " data - audio = " {{ details[6]}} " data - languages = " {{ !subs_languages_list}} " data - hearing - impaired = " {{ details[4]}} " data - forced = " {{ details[15]}} " > < i class = " ui inverted large compact configure icon " > < / i > < / button >
2019-04-20 21:15:00 +00:00
< / div >
< / div >
< / div >
< div class = " ui row " >
{ { details [ 1 ] } }
< / div >
< div class = " ui row " >
< div class = " ui tiny inverted label " style = ' background-color: #777777; ' > { { details [ 6 ] } } < / div >
< div class = " ui tiny inverted label " style = ' background-color: #35c5f4; ' > { { details [ 8 ] } } < / div >
% if details [ 12 ] is not None :
< div class = " ui tiny inverted label " style = ' background-color: orange; ' > { { details [ 12 ] } } < / div >
% end
< / div >
2019-05-21 13:13:49 +00:00
< div class = " ui row " style = " padding-bottom: 0.5em; " >
2019-04-20 21:15:00 +00:00
% for language in subs_languages_list :
< div class = " ui tiny inverted label " style = ' background-color: #35c5f4; ' > { { language } } < / div >
% end
< / div >
2019-05-21 13:13:49 +00:00
< div class = " ui row " style = " padding-top: 0em; " >
< div class = " ui tiny inverted label " style = ' background-color: #777777; ' > Hearing - impaired : { { details [ 4 ] } } < / div >
< div class = " ui tiny inverted label " style = ' background-color: #777777; ' > Forced : { { details [ 15 ] } } < / div >
< / div >
2019-04-20 21:15:00 +00:00
< / div >
< / div >
2018-04-19 23:45:10 +00:00
< / div >
2018-04-24 14:48:52 +00:00
< div id = " fondblanc " class = " ui container " >
< table class = " ui very basic single line selectable table " >
< thead >
< tr >
2018-05-02 10:25:42 +00:00
< th > Subtitles path < / th >
< th > Language < / th >
< th > < / th >
2018-04-24 14:48:52 +00:00
< / tr >
< / thead >
< tbody >
2018-05-02 10:25:42 +00:00
< %
subtitles_files = ast . literal_eval ( str ( details [ 9 ] ) )
2018-07-30 00:42:24 +00:00
subtitles_files . sort ( )
2018-05-02 10:25:42 +00:00
if subtitles_files is not None :
for subtitles_file in subtitles_files :
2019-04-04 11:11:53 +00:00
if subtitles_file [ 0 ] . endswith ( ' :forced ' ) :
forced = True
2019-03-29 01:39:18 +00:00
else :
forced = False
end
2018-05-02 10:25:42 +00:00
% >
2018-04-24 14:48:52 +00:00
< tr >
2018-06-06 00:06:00 +00:00
< td > { { path_replace_movie ( subtitles_file [ 1 ] ) if subtitles_file [ 1 ] is not None else ' Video file subtitles track ' } } < / td >
2019-04-27 12:13:47 +00:00
< td > < div class = " ui tiny inverted label " style = ' background-color: #777777; ' > { { language_from_alpha2 ( subtitles_file [ 0 ] . split ( ' : ' ) [ 0 ] ) } } { { ' forced ' if forced else ' ' } } < / div > < / td >
2018-05-02 10:25:42 +00:00
< td >
% if subtitles_file [ 1 ] is not None :
2019-04-04 11:11:53 +00:00
< a class = " remove_subtitles ui inverted basic compact icon " data - tooltip = " Delete subtitles file from disk " data - inverted = " " data - position = " top right " data - moviePath = " {{ details[8]}} " data - subtitlesPath = " {{ path_replace_movie(subtitles_file[1])}} " data - language = " {{ alpha3_from_alpha2(subtitles_file[0].split( ' : ' )[0])}} " data - radarrId = { { details [ 10 ] } } >
2018-05-02 10:25:42 +00:00
< i class = " ui black delete icon " > < / i >
< / a >
% end
< / td >
2018-04-24 14:48:52 +00:00
< / tr >
2018-05-02 10:25:42 +00:00
< %
end
if len ( subtitles_files ) == 0 :
% >
< tr > < td colspan = " 3 " > No subtitles detected for this movie . < / td > < / tr >
< %
end
end
% >
2018-04-24 14:48:52 +00:00
< / tbody >
< / table >
2018-05-02 10:25:42 +00:00
< %
2018-11-27 20:00:13 +00:00
if details [ 11 ] is not None :
missing_subs_languages = ast . literal_eval ( details [ 11 ] )
else :
2018-11-28 03:55:25 +00:00
missing_subs_languages = [ ]
2018-11-27 20:00:13 +00:00
end
2018-11-28 03:55:25 +00:00
from get_subtitle import search_active
2018-05-02 10:25:42 +00:00
if missing_subs_languages is not None :
% >
< table class = " ui very basic single line selectable table " >
< thead >
< tr >
< th > Missing subtitles < / th >
< / tr >
< / thead >
< / table >
< %
for missing_subs_language in missing_subs_languages :
2019-04-02 02:34:03 +00:00
if len ( missing_subs_language ) > 2 :
forced = missing_subs_language [ 2 ]
else :
forced = False
end
2018-12-27 19:19:59 +00:00
if details [ 14 ] is not None and settings . general . getboolean ( ' adaptive_searching ' ) and missing_subs_language in details [ 14 ] :
2018-11-08 13:03:34 +00:00
for lang in ast . literal_eval ( details [ 14 ] ) :
if missing_subs_language in lang :
if search_active ( lang [ 1 ] ) :
2018-05-02 10:25:42 +00:00
% >
2019-04-02 02:34:03 +00:00
< a class = " get_subtitle ui small blue label " data - moviePath = " {{ details[8]}} " data - scenename = " {{ details[12]}} " data - language = " {{ alpha3_from_alpha2(str(missing_subs_language.split( ' : ' )[0]))}} " data - hi = " {{ details[4]}} " data - forced = " {{ details[15]}} " data - radarrId = { { details [ 10 ] } } >
2019-04-27 12:13:47 +00:00
{ { language_from_alpha2 ( str ( missing_subs_language . split ( ' : ' ) [ 0 ] ) ) } } { { ' forced ' if forced else ' ' } }
2018-12-09 20:23:51 +00:00
< i style = " margin-left:3px; margin-right:0 " class = " search icon " > < / i >
2018-05-02 10:25:42 +00:00
< / a >
2018-11-08 13:03:34 +00:00
% else :
2019-04-02 02:34:03 +00:00
< a data - tooltip = " Automatic searching delayed (adaptive search) " data - position = " top left " data - inverted = " " class = " get_subtitle ui small red label " data - moviePath = " {{ details[8]}} " data - scenename = " {{ details[12]}} " data - language = " {{ alpha3_from_alpha2(str(missing_subs_language.split( ' : ' )[0]))}} " data - hi = " {{ details[4]}} " data - forced = " {{ details[15]}} " data - radarrId = { { details [ 10 ] } } >
2019-04-27 12:13:47 +00:00
{ { language_from_alpha2 ( str ( missing_subs_language . split ( ' : ' ) [ 0 ] ) ) } } { { ' forced ' if forced else ' ' } }
2018-12-09 20:23:51 +00:00
< i style = " margin-left:3px; margin-right:0 " class = " search icon " > < / i >
2018-11-08 13:03:34 +00:00
< / a >
2018-05-02 10:25:42 +00:00
< %
2018-11-08 13:03:34 +00:00
end
end
end
else :
% >
2019-04-02 02:34:03 +00:00
< a class = " get_subtitle ui small blue label " data - moviePath = " {{ details[8]}} " data - scenename = " {{ details[12]}} " data - language = " {{ alpha3_from_alpha2(str(missing_subs_language.split( ' : ' )[0]))}} " data - hi = " {{ details[4]}} " data - forced = " {{ details[15]}} " data - radarrId = { { details [ 10 ] } } >
2019-04-27 12:13:47 +00:00
{ { language_from_alpha2 ( str ( missing_subs_language . split ( ' : ' ) [ 0 ] ) ) } } { { ' forced ' if forced else ' ' } }
2018-12-09 20:23:51 +00:00
< i style = " margin-left:3px; margin-right:0 " class = " search icon " > < / i >
2018-11-08 13:03:34 +00:00
< / a >
< %
end
2018-05-02 10:25:42 +00:00
end
end
% >
2018-04-24 14:48:52 +00:00
< / div >
2018-04-19 23:45:10 +00:00
< / div >
< / div >
2018-09-10 21:10:33 +00:00
< div class = " config_dialog ui small modal " >
2018-04-19 23:45:10 +00:00
< i class = " close icon " > < / i >
< div class = " header " >
< div id = " movie_title " > < / div >
< / div >
< div class = " content " >
< form name = " movie_form " id = " movie_form " action = " " method = " post " class = " ui form " >
< div class = " ui grid " >
< div class = " four wide column " >
< img id = " movie_poster " class = " ui image " src = " " >
< / div >
< div class = " twelve wide column " >
< div class = " ui grid " >
< div class = " middle aligned row " >
< div class = " right aligned five wide column " >
< label > Audio language < / label >
< / div >
< div class = " nine wide column " >
< div id = " movie_audio_language " > < / div >
< / div >
< / div >
< div class = " middle aligned row " >
< div class = " right aligned five wide column " >
< label > Subtitles languages < / label >
< / div >
< div class = " nine wide column " >
2018-08-23 19:58:15 +00:00
< select name = " languages " id = " movie_languages " { { ! ' multiple= " " ' if single_language is False else ' ' } } class = " ui fluid selection dropdown " >
2018-04-19 23:45:10 +00:00
< option value = " " > Languages < / option >
2019-02-23 23:26:19 +00:00
% if single_language :
< option value = " None " > None < / option >
% end
2018-04-19 23:45:10 +00:00
% for language in languages :
< option value = " {{ language[0]}} " > { { language [ 1 ] } } < / option >
% end
< / select >
< / div >
< / div >
< div class = " middle aligned row " >
< div class = " right aligned five wide column " >
< label > Hearing - impaired < / label >
< / div >
< div class = " nine wide column " >
< div id = " movie_hearing-impaired_div " class = " ui toggle checkbox " >
< input name = " hearing_impaired " id = " movie_hearing-impaired " type = " checkbox " >
< label > < / label >
< / div >
< / div >
< / div >
2019-05-22 03:33:59 +00:00
< div class = " middle aligned row " >
< div class = " right aligned five wide column " >
< label > Forced < / label >
< / div >
< div class = " nine wide column " >
< select name = " forced " id = " movie_forced " class = " ui fluid selection dropdown " >
< option value = " False " > False < / option >
< option value = " True " > True < / option >
< option value = " Both " > Both < / option >
< / select >
< / div >
< / div >
2018-04-19 23:45:10 +00:00
< / div >
< / div >
< / div >
< / form >
< / div >
< div class = " actions " >
< button class = " ui cancel button " > Cancel < / button >
< button type = " submit " name = " save " value = " save " form = " movie_form " class = " ui blue approve button " > Save < / button >
< / div >
< / div >
2018-09-10 21:10:33 +00:00
< div class = " search_dialog ui modal " >
< i class = " close icon " > < / i >
< div class = " header " >
< span id = " movie_title_span " > < / span >
< / 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; " > Provider : < / th >
< th style = " text-align: left; " > Based on : < / th >
< th > < / th >
< / tr >
< / thead >
< / table >
< / div >
< div class = " actions " >
< button class = " ui cancel button " > Cancel < / button >
< / div >
< / div >
2018-04-19 23:45:10 +00:00
% include ( ' footer.tpl ' )
< / body >
< / html >
< script >
2018-12-09 20:23:51 +00:00
$ ( ' #scan_disk ' ) . on ( ' click ' , function ( ) {
2018-09-10 21:10:33 +00:00
$ ( ' #loader_text ' ) . text ( " Scanning disk for existing subtitles... " ) ;
2018-04-24 14:48:52 +00:00
window . location = ' {{ base_url}}scan_disk_movie/ {{ no}} ' ;
2018-12-09 20:23:51 +00:00
} ) ;
2018-04-19 23:45:10 +00:00
2019-02-25 04:05:58 +00:00
$ ( ' #search_missing_subtitles_movie ' ) . on ( ' click ' , function ( ) {
2019-02-26 00:48:43 +00:00
$ ( this ) . addClass ( ' disabled ' ) ;
2019-02-25 04:05:58 +00:00
$ ( this ) . find ( ' i:first ' ) . addClass ( ' loading ' ) ;
$ . ajax ( {
url : ' {{ base_url}}search_missing_subtitles_movie/ {{ no}} '
} )
2018-12-09 20:23:51 +00:00
} ) ;
2018-04-19 23:45:10 +00:00
2018-12-09 20:23:51 +00:00
$ ( ' .remove_subtitles ' ) . on ( ' click ' , function ( ) {
const values = {
2018-09-10 21:10:33 +00:00
moviePath : $ ( this ) . attr ( " data-moviePath " ) ,
language : $ ( this ) . attr ( " data-language " ) ,
subtitlesPath : $ ( this ) . attr ( " data-subtitlesPath " ) ,
radarrId : $ ( this ) . attr ( " data-radarrId " ) ,
tmdbid : { { tmdbid } }
} ;
$ ( ' #loader_text ' ) . text ( " Deleting subtitle from disk... " ) ;
$ . ajax ( {
url : " {{ base_url}}remove_subtitles_movie " ,
type : " POST " ,
dataType : " json " ,
data : values
} ) ;
$ ( document ) . ajaxStart ( function ( ) {
$ ( ' #loader ' ) . addClass ( ' active ' ) ;
} ) ;
$ ( document ) . ajaxStop ( function ( ) {
window . location . reload ( ) ;
} ) ;
2018-12-09 20:23:51 +00:00
} ) ;
2018-04-19 23:45:10 +00:00
2018-12-09 20:23:51 +00:00
$ ( ' .get_subtitle ' ) . on ( ' click ' , function ( ) {
const values = {
2018-09-10 21:10:33 +00:00
moviePath : $ ( this ) . attr ( " data-moviePath " ) ,
sceneName : $ ( this ) . attr ( " data-sceneName " ) ,
language : $ ( this ) . attr ( " data-language " ) ,
hi : $ ( this ) . attr ( " data-hi " ) ,
2019-03-31 03:09:52 +00:00
forced : $ ( this ) . attr ( " data-forced " ) ,
2018-09-10 21:10:33 +00:00
radarrId : $ ( this ) . attr ( " data-radarrId " ) ,
2018-11-29 13:03:44 +00:00
tmdbid : { { tmdbid } } ,
2019-02-02 07:54:29 +00:00
title : " {{ !details[0].replace( " ' " , " \\ ' " )}} "
2018-09-10 21:10:33 +00:00
} ;
$ ( ' #loader_text ' ) . text ( " Downloading subtitle to disk... " ) ;
$ . ajax ( {
url : " {{ base_url}}get_subtitle_movie " ,
type : " POST " ,
dataType : " json " ,
data : values
} ) ;
$ ( document ) . ajaxStart ( function ( ) {
$ ( ' #loader ' ) . addClass ( ' active ' ) ;
} ) ;
$ ( document ) . ajaxStop ( function ( ) {
window . location . reload ( ) ;
} ) ;
2018-12-09 20:23:51 +00:00
} ) ;
2018-04-19 23:45:10 +00:00
2019-02-25 04:05:58 +00:00
$ ( ' a, .menu .item, button:not(#config, .cancel, .manual_search, #search_missing_subtitles_movie) ' ) . on ( ' click ' , function ( ) {
2018-04-19 23:45:10 +00:00
$ ( ' #loader ' ) . addClass ( ' active ' ) ;
2018-12-09 20:23:51 +00:00
} ) ;
2018-04-19 23:45:10 +00:00
$ ( ' .modal ' )
. modal ( {
autofocus : false
2018-12-09 20:23:51 +00:00
} ) ;
2018-04-19 23:45:10 +00:00
2018-12-09 20:23:51 +00:00
$ ( ' #config ' ) . on ( ' click ' , function ( ) {
2018-04-19 23:45:10 +00:00
$ ( ' #movie_form ' ) . attr ( ' action ' , ' {{ base_url}}edit_movie/ {{ no}} ' ) ;
$ ( " #movie_title " ) . html ( $ ( this ) . data ( " title " ) ) ;
$ ( " #movie_poster " ) . attr ( " src " , " {{ base_url}}image_proxy_movies " + $ ( this ) . data ( " poster " ) ) ;
$ ( " #movie_audio_language " ) . html ( $ ( this ) . data ( " audio " ) ) ;
$ ( ' #movie_languages ' ) . dropdown ( ' clear ' ) ;
2018-12-09 20:23:51 +00:00
const languages_array = eval ( $ ( this ) . data ( " languages " ) ) ;
2018-04-19 23:45:10 +00:00
$ ( ' #movie_languages ' ) . dropdown ( ' set selected ' , languages_array ) ;
2019-05-22 03:33:59 +00:00
$ ( ' #movie_forced ' ) . dropdown ( ' clear ' ) ;
$ ( ' #movie_forced ' ) . dropdown ( ' set selected ' , $ ( this ) . data ( " forced " ) ) ;
2018-12-09 20:23:51 +00:00
if ( $ ( this ) . data ( " hearing-impaired " ) == = " True " ) {
2018-04-19 23:45:10 +00:00
$ ( " #movie_hearing-impaired_div " ) . checkbox ( ' check ' ) ;
} else {
$ ( " #movie_hearing-impaired_div " ) . checkbox ( ' uncheck ' ) ;
}
2019-05-22 03:33:59 +00:00
$ ( ' .config_dialog ' ) . modal ( ' show ' ) ;
2018-12-09 20:23:51 +00:00
} ) ;
2018-09-10 21:10:33 +00:00
2018-12-09 20:23:51 +00:00
$ ( ' .manual_search ' ) . on ( ' click ' , function ( ) {
2018-09-10 21:10:33 +00:00
$ ( " #movie_title_span " ) . html ( $ ( this ) . data ( " movie_title " ) ) ;
2018-12-09 20:23:51 +00:00
moviePath = $ ( this ) . attr ( " data-moviePath " ) ;
sceneName = $ ( this ) . attr ( " data-sceneName " ) ;
language = $ ( this ) . attr ( " data-language " ) ;
hi = $ ( this ) . attr ( " data-hi " ) ;
2019-03-31 03:09:52 +00:00
forced = $ ( this ) . attr ( " data-forced " ) ;
2018-12-09 20:23:51 +00:00
radarrId = $ ( this ) . attr ( " data-radarrId " ) ;
2019-03-20 00:16:19 +00:00
var languages = Array . from ( { { ! subs_languages_list } } ) ;
var is_pb = languages . includes ( ' pb ' ) ;
var is_pt = languages . includes ( ' pt ' ) ;
2018-09-10 21:10:33 +00:00
2018-12-09 20:23:51 +00:00
const values = {
2018-09-10 21:10:33 +00:00
moviePath : moviePath ,
sceneName : sceneName ,
language : language ,
hi : hi ,
2019-03-31 03:09:52 +00:00
forced : forced ,
2018-11-29 11:20:39 +00:00
radarrId : radarrId ,
2019-02-02 07:54:29 +00:00
title : " {{ !details[0].replace( " ' " , " \' " )}} "
2018-09-10 21:10:33 +00:00
} ;
$ ( ' #search_result ' ) . DataTable ( {
destroy : true ,
language : {
loadingRecords : ' <br><div class= " ui active inverted dimmer " style= " width: 95 % ; " ><div class= " ui centered inline loader " ></div></div><br> ' ,
zeroRecords : ' No subtitles found for this movie '
} ,
paging : true ,
2019-01-28 02:19:56 +00:00
lengthChange : false ,
pageLength : 5 ,
2018-09-10 21:10:33 +00:00
searching : false ,
ordering : false ,
processing : false ,
serverSide : false ,
2019-01-28 02:19:56 +00:00
ajax : {
2018-09-10 21:10:33 +00:00
url : ' {{ base_url}}manual_search_movie ' ,
type : ' POST ' ,
data : values
} ,
drawCallback : function ( settings ) {
$ ( ' .inline.dropdown ' ) . dropdown ( ) ;
} ,
columns : [
{ data : ' score ' ,
render : function ( data , type , row ) {
return data + ' % ' ;
}
} ,
2019-03-20 00:16:19 +00:00
{ data : null ,
render : function ( data , type , row ) {
if ( data . language == = " pt " & & is_pb == = true & & is_pt == = false ) {
return ' pb '
2019-04-04 11:11:53 +00:00
} else if ( data . language == = " pt:forced " & & is_pb == = true & & is_pt == = false ) {
return ' pb:forced '
2019-03-20 00:16:19 +00:00
} else {
return data . language
}
}
} ,
2018-09-10 21:10:33 +00:00
{ data : ' hearing_impaired ' } ,
{ data : null ,
render : function ( data , type , row ) {
return ' <a href= " ' + data . url + ' " target= " _blank " > ' + data . provider + ' </a> ' ;
}
} ,
{ data : null ,
render : function ( data , type , row ) {
2018-12-09 20:23:51 +00:00
const array_matches = data . matches ;
const array_dont_matches = data . dont_matches ;
let i ;
let text = ' <div class= " ui inline dropdown " ><i class= " green check icon " ></i><div class= " text " > ' ;
2018-09-10 21:10:33 +00:00
text + = array_matches . length ;
2018-12-09 20:23:51 +00:00
text + = ' </div><i class= " dropdown icon " ></i><div class= " menu " > ' ;
2018-09-10 21:10:33 +00:00
for ( i = 0 ; i < array_matches . length ; i + + ) {
text + = ' <div class= " criteria_matched disabled item " > ' + array_matches [ i ] + ' </div> ' ;
}
text + = ' </div></div> ' ;
2018-12-09 20:23:51 +00:00
text + = ' <div class= " ui inline dropdown " ><i class= " red times icon " ></i><div class= " text " > ' ;
2018-09-10 21:10:33 +00:00
text + = array_dont_matches . length ;
2018-12-09 20:23:51 +00:00
text + = ' </div><i class= " dropdown icon " ></i><div class= " menu " > ' ;
2018-09-10 21:10:33 +00:00
for ( i = 0 ; i < array_dont_matches . length ; i + + ) {
text + = ' <div class= " criteria_not_matched disabled item " > ' + array_dont_matches [ 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> ' ;
}
}
]
} ) ;
$ ( ' .search_dialog ' )
. modal ( {
centered : false
} )
. modal ( ' show ' )
;
2018-12-09 20:23:51 +00:00
} ) ;
2018-09-10 21:10:33 +00:00
2019-01-19 13:57:16 +00:00
function manual_get ( button , episodePath , sceneName , hi ) {
2018-12-09 20:23:51 +00:00
const values = {
2018-09-10 21:10:33 +00:00
subtitle : $ ( button ) . attr ( " data-subtitle " ) ,
provider : $ ( button ) . attr ( " data-provider " ) ,
moviePath : moviePath ,
sceneName : sceneName ,
language : $ ( button ) . attr ( " data-language " ) ,
hi : hi ,
2018-11-29 13:40:31 +00:00
radarrId : radarrId ,
2019-02-02 07:54:29 +00:00
title : " {{ !details[0].replace( " ' " , " \\ ' " )}} "
2018-09-10 21:10:33 +00:00
} ;
$ ( ' #loader_text ' ) . text ( " Downloading subtitle to disk... " ) ;
$ ( ' #loader ' ) . addClass ( ' active ' ) ;
$ ( ' .search_dialog ' ) . modal ( ' hide ' ) ;
$ . ajax ( {
url : " {{ base_url}}manual_get_subtitle_movie " ,
type : " POST " ,
dataType : " json " ,
data : values
} ) ;
$ ( document ) . ajaxStop ( function ( ) {
window . location . reload ( ) ;
} ) ;
2018-12-15 00:36:28 +00:00
}
2018-04-19 23:45:10 +00:00
< / script >