mirror of
https://github.com/morpheus65535/bazarr
synced 2025-03-12 07:03:12 +00:00
manual_search: implement hints, use full parsing with sceneName
This commit is contained in:
parent
890fb25a01
commit
fca858c669
4 changed files with 18 additions and 9 deletions
|
@ -280,7 +280,7 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName,
|
|||
logging.debug('BAZARR Ended searching subtitles for file: ' + path)
|
||||
|
||||
|
||||
def manual_search(path, language, hi, providers, providers_auth, sceneName, media_type):
|
||||
def manual_search(path, language, hi, providers, providers_auth, sceneName, title, media_type):
|
||||
logging.debug('BAZARR Manually searching subtitles for this file: ' + path)
|
||||
|
||||
final_subtitles = []
|
||||
|
@ -301,11 +301,16 @@ def manual_search(path, language, hi, providers, providers_auth, sceneName, medi
|
|||
use_postprocessing = get_general_settings()[10]
|
||||
postprocessing_cmd = get_general_settings()[11]
|
||||
|
||||
hints = {"title": title}
|
||||
dont_use_actual_file = False
|
||||
if sceneName != "None" and use_scenename:
|
||||
# use the sceneName but keep the folder structure for better guessing
|
||||
path = os.path.join(os.path.dirname(path), sceneName + os.path.splitext(path)[1])
|
||||
dont_use_actual_file = True
|
||||
|
||||
try:
|
||||
if sceneName == "None" or not use_scenename:
|
||||
video = parse_video(path, None, providers=providers)
|
||||
else:
|
||||
video = Video.fromname(sceneName)
|
||||
video = parse_video(path, hints=hints, providers=providers, dry_run=dont_use_actual_file)
|
||||
|
||||
except:
|
||||
logging.exception("BAZARR Error trying to get video information for this file: " + path)
|
||||
else:
|
||||
|
|
|
@ -1650,11 +1650,12 @@ def manual_search_json():
|
|||
sceneName = request.forms.get('sceneName')
|
||||
language = request.forms.get('language')
|
||||
hi = request.forms.get('hi')
|
||||
title = request.forms.get('title')
|
||||
|
||||
providers_list = get_providers()
|
||||
providers_auth = get_providers_auth()
|
||||
|
||||
data = manual_search(episodePath, language, hi, providers_list, providers_auth, sceneName, 'series')
|
||||
data = manual_search(episodePath, language, hi, providers_list, providers_auth, sceneName, title, 'series')
|
||||
return dict(data=data)
|
||||
|
||||
|
||||
|
@ -1727,11 +1728,12 @@ def manual_search_movie_json():
|
|||
sceneName = request.forms.get('sceneName')
|
||||
language = request.forms.get('language')
|
||||
hi = request.forms.get('hi')
|
||||
title = request.forms.get('title')
|
||||
|
||||
providers_list = get_providers()
|
||||
providers_auth = get_providers_auth()
|
||||
|
||||
data = manual_search(moviePath, language, hi, providers_list, providers_auth, sceneName, 'movie')
|
||||
data = manual_search(moviePath, language, hi, providers_list, providers_auth, sceneName, title, 'movie')
|
||||
return dict(data=data)
|
||||
|
||||
|
||||
|
|
|
@ -473,7 +473,8 @@
|
|||
language: language,
|
||||
hi: hi,
|
||||
sonarrSeriesId: sonarrSeriesId,
|
||||
sonarrEpisodeId: sonarrEpisodeId
|
||||
sonarrEpisodeId: sonarrEpisodeId,
|
||||
title: $(this).data("series_title")
|
||||
};
|
||||
|
||||
$('#search_result').DataTable( {
|
||||
|
|
|
@ -416,7 +416,8 @@
|
|||
sceneName: sceneName,
|
||||
language: language,
|
||||
hi: hi,
|
||||
radarrId: radarrId
|
||||
radarrId: radarrId,
|
||||
title: $(this).data("movie_title")
|
||||
};
|
||||
|
||||
$('#search_result').DataTable( {
|
||||
|
|
Loading…
Add table
Reference in a new issue