no log: Remove mapped_path in Subtitle property to maintain API consistency

pull/1427/head v0.9.6-beta.18
LASER-Yi 3 years ago
parent d4aed7457a
commit 0ef9729f9d

@ -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,

@ -37,7 +37,6 @@ interface Subtitle extends Language {
forced: boolean;
hi: boolean;
path: string | null;
mapped_path: string | null;
}
interface PathType {

@ -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;
}
},
},

Loading…
Cancel
Save