diff options
-rw-r--r-- | bazarr/api.py | 10 | ||||
-rw-r--r-- | frontend/src/@types/api.d.ts | 1 | ||||
-rw-r--r-- | frontend/src/Movies/Detail/table.tsx | 10 |
3 files changed, 11 insertions, 10 deletions
diff --git a/bazarr/api.py b/bazarr/api.py index 6ea8cf15e..eb392baaa 100644 --- a/bazarr/api.py +++ b/bazarr/api.py @@ -158,8 +158,7 @@ def postprocessEpisode(item): sub = {"name": language_from_alpha2(subtitle[0]), "code2": subtitle[0], "code3": alpha3_from_alpha2(subtitle[0]), - "path": subs[1], - "mapped_path": path_mappings.path_replace(subs[1]), + "path": path_mappings.path_replace(subs[1]), "forced": False, "hi": False} if len(subtitle) > 1: @@ -225,8 +224,7 @@ def postprocessMovie(item): item['subtitles'] = ast.literal_eval(item['subtitles']) for i, subs in enumerate(item['subtitles']): language = subs[0].split(':') - item['subtitles'][i] = {"path": subs[1], - "mapped_path": path_mappings.path_replace_movie(subs[1]), + item['subtitles'][i] = {"path": path_mappings.path_replace_movie(subs[1]), "name": language_from_alpha2(language[0]), "code2": language[0], "code3": alpha3_from_alpha2(language[0]), @@ -869,6 +867,8 @@ class EpisodesSubtitles(Resource): hi = request.form.get('hi') subtitlesPath = request.form.get('path') + subtitlesPath = path_mappings.path_replace_reverse(subtitlesPath) + result = delete_subtitles(media_type='series', language=language, forced=forced, @@ -1090,6 +1090,8 @@ class MoviesSubtitles(Resource): hi = request.form.get('hi') subtitlesPath = request.form.get('path') + subtitlesPath = path_mappings.path_replace_reverse_movie(subtitlesPath) + result = delete_subtitles(media_type='movie', language=language, forced=forced, diff --git a/frontend/src/@types/api.d.ts b/frontend/src/@types/api.d.ts index ccccc159b..968237290 100644 --- a/frontend/src/@types/api.d.ts +++ b/frontend/src/@types/api.d.ts @@ -37,7 +37,6 @@ interface Subtitle extends Language { forced: boolean; hi: boolean; path: string | null; - mapped_path: string | null; } interface PathType { diff --git a/frontend/src/Movies/Detail/table.tsx b/frontend/src/Movies/Detail/table.tsx index 58500fdcb..1bea23623 100644 --- a/frontend/src/Movies/Detail/table.tsx +++ b/frontend/src/Movies/Detail/table.tsx @@ -26,13 +26,13 @@ const Table: FunctionComponent<Props> = ({ movie, profile }) => { { Header: "Subtitle Path", accessor: "path", - Cell: (row) => { - if (row.value === null || row.value.length === 0) { + Cell: ({ value }) => { + if (value === null || value.length === 0) { return "Video File Subtitle Track"; - } else if (row.value === missingText) { - return <span className="text-muted">{row.value}</span>; + } else if (value === missingText) { + return <span className="text-muted">{value}</span>; } else { - return row.row.original.mapped_path; + return value; } }, }, |