From 0ef9729f9d7804844c897630ca80f32f839380d8 Mon Sep 17 00:00:00 2001 From: LASER-Yi Date: Fri, 4 Jun 2021 12:42:50 +0800 Subject: no log: Remove mapped_path in Subtitle property to maintain API consistency --- bazarr/api.py | 10 ++++++---- frontend/src/@types/api.d.ts | 1 - 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 = ({ 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 {row.value}; + } else if (value === missingText) { + return {value}; } else { - return row.row.original.mapped_path; + return value; } }, }, -- cgit v1.2.3