diff options
author | LASER-Yi <[email protected]> | 2021-06-04 12:42:50 +0800 |
---|---|---|
committer | LASER-Yi <[email protected]> | 2021-06-04 12:42:50 +0800 |
commit | 0ef9729f9d7804844c897630ca80f32f839380d8 (patch) | |
tree | 2a9c14412d50ba7771eaa7ed375d265a6436be39 | |
parent | d4aed7457a428685c3883eca6a1bc14f3352d707 (diff) | |
download | bazarr-0ef9729f9d7804844c897630ca80f32f839380d8.tar.gz bazarr-0ef9729f9d7804844c897630ca80f32f839380d8.zip |
no log: Remove mapped_path in Subtitle property to maintain API consistencyv0.9.6-beta.18
-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; } }, }, |