pull/884/head
Louis Vézina 5 years ago
parent 0ff76397c7
commit 5ab85cdbfa

@ -1473,11 +1473,11 @@ def execute_task(taskid):
@app.route('/remove_subtitles', methods=['POST']) @app.route('/remove_subtitles', methods=['POST'])
@login_required @login_required
def remove_subtitles(): def remove_subtitles():
episodePath = request.forms.episodePath episodePath = request.form.get('episodePath')
language = request.forms.get('language') language = request.form.get('language')
subtitlesPath = request.forms.subtitlesPath subtitlesPath = request.form.get('subtitlesPath')
sonarrSeriesId = request.forms.get('sonarrSeriesId') sonarrSeriesId = request.form.get('sonarrSeriesId')
sonarrEpisodeId = request.forms.get('sonarrEpisodeId') sonarrEpisodeId = request.form.get('sonarrEpisodeId')
try: try:
os.remove(path_replace(subtitlesPath)) os.remove(path_replace(subtitlesPath))
@ -1485,7 +1485,7 @@ def remove_subtitles():
history_log(0, sonarrSeriesId, sonarrEpisodeId, result, language=alpha2_from_alpha3(language)) history_log(0, sonarrSeriesId, sonarrEpisodeId, result, language=alpha2_from_alpha3(language))
except OSError as e: except OSError as e:
logging.exception('BAZARR cannot delete subtitles file: ' + subtitlesPath) logging.exception('BAZARR cannot delete subtitles file: ' + subtitlesPath)
store_subtitles(episodePath, path_replace(episodePath)) store_subtitles(path_replace_reverse(episodePath), episodePath)
return '' return ''
@ -1493,10 +1493,10 @@ def remove_subtitles():
@app.route('/remove_subtitles_movie', methods=['POST']) @app.route('/remove_subtitles_movie', methods=['POST'])
@login_required @login_required
def remove_subtitles_movie(): def remove_subtitles_movie():
moviePath = request.forms.moviePath moviePath = request.form.get('moviePath')
language = request.forms.get('language') language = request.form.get('language')
subtitlesPath = request.forms.subtitlesPath subtitlesPath = request.form.get('subtitlesPath')
radarrId = request.forms.get('radarrId') radarrId = request.form.get('radarrId')
try: try:
os.remove(subtitlesPath) os.remove(subtitlesPath)

@ -173,7 +173,7 @@
if (value[1] === null) { if (value[1] === null) {
languages = languages + '<span class="badge badge-secondary" data-toggle="tooltip" data-placement="right" title="' + value[0].name + ((value[0].forced) ? ' forced':'') + '">' + value[0].code2 + ((value[0].forced) ? ':forced':'') + '</span> '; languages = languages + '<span class="badge badge-secondary" data-toggle="tooltip" data-placement="right" title="' + value[0].name + ((value[0].forced) ? ' forced':'') + '">' + value[0].code2 + ((value[0].forced) ? ':forced':'') + '</span> ';
} else { } else {
languages = languages + '<a href="" class="remove_subtitles badge badge-secondary" data-toggle="tooltip" data-placement="right" title="' + value[0].name + ((value[0].forced) ? ' forced':'') + '" data-episodePath="'+data.path+'" data-language="'+value[0].code3+'" data-subtitlesPath="'+value[1]+'" data-sonarrEpisodeId='+data.sonarrEpisodeId+'>' + value[0].code2 + ((value[0].forced) ? ':forced':'') + ' <i class="far fa-trash-alt"></i></a> '; languages = languages + '<a href="" class="remove_subtitles badge badge-secondary" data-toggle="tooltip" data-placement="right" title="' + value[0].name + ((value[0].forced) ? ' forced':'') + '" data-episodePath="'+data.mapped_path+'" data-language="'+value[0].code3+'" data-subtitlesPath="'+value[1]+'" data-sonarrEpisodeId='+data.sonarrEpisodeId+'>' + value[0].code2 + ((value[0].forced) ? ':forced':'') + ' <i class="far fa-trash-alt"></i></a> ';
} }
} }
} }
@ -189,7 +189,7 @@
} }
function appendFunc(value) { function appendFunc(value) {
languages = languages + '<a href="" class="get_subtitle badge badge-secondary" data-toggle="tooltip" data-placement="right" title="' + value.name + ((value.forced) ? ' forced':'') + '" data-episodepath="'+data.path+'" data-scenename="'+data.scene_name+'" data-title="'+data.title+'" data-language="'+value.code3+'" data-hi="'+seriesDetails.hearing_impaired+'" data-forced="'+value.forced+'" data-sonarrepisodeid='+data.sonarrEpisodeId+'>' + value.code2 + ((value.forced) ? ':forced':'') + ' <i class="fas fa-search"></i></a> '; languages = languages + '<a href="" class="get_subtitle badge badge-secondary" data-toggle="tooltip" data-placement="right" title="' + value.name + ((value.forced) ? ' forced':'') + '" data-episodepath="'+data.mapped_path+'" data-scenename="'+data.scene_name+'" data-title="'+data.title+'" data-language="'+value.code3+'" data-hi="'+seriesDetails.hearing_impaired+'" data-forced="'+value.forced+'" data-sonarrepisodeid='+data.sonarrEpisodeId+'>' + value.code2 + ((value.forced) ? ':forced':'') + ' <i class="fas fa-search"></i></a> ';
} }
} }
}, },

Loading…
Cancel
Save