diff options
author | LASER-Yi <[email protected]> | 2021-05-09 11:42:21 +0800 |
---|---|---|
committer | LASER-Yi <[email protected]> | 2021-05-09 11:42:21 +0800 |
commit | b4037442b15eda59e6b7bc1a48988d28e78a30e1 (patch) | |
tree | b2826e124fbd15681247ade8a1b1b6354367ce48 | |
parent | a417f35856faf18086adbc05af43a52a45838880 (diff) | |
download | bazarr-b4037442b15eda59e6b7bc1a48988d28e78a30e1.tar.gz bazarr-b4037442b15eda59e6b7bc1a48988d28e78a30e1.zip |
Fix an issue that cause subtitles missing in movie page
-rw-r--r-- | frontend/src/Movies/Detail/index.tsx | 6 | ||||
-rw-r--r-- | frontend/src/Movies/Detail/table.tsx | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/frontend/src/Movies/Detail/index.tsx b/frontend/src/Movies/Detail/index.tsx index 8cc6a9239..593fabf50 100644 --- a/frontend/src/Movies/Detail/index.tsx +++ b/frontend/src/Movies/Detail/index.tsx @@ -11,7 +11,7 @@ import React, { FunctionComponent, useCallback, useState } from "react"; import { Container, Row } from "react-bootstrap"; import { Helmet } from "react-helmet"; import { Redirect, RouteComponentProps, withRouter } from "react-router-dom"; -import { useMovieBy } from "../../@redux/hooks"; +import { useMovieBy, useProfileBy } from "../../@redux/hooks"; import { MoviesApi, ProvidersApi } from "../../apis"; import { ContentHeader, @@ -51,6 +51,8 @@ const MovieDetailView: FunctionComponent<Props> = ({ match }) => { const [movie] = useMovieBy(id); const item = movie.data; + const profile = useProfileBy(movie.data?.profileId); + const showModal = useShowModal(); const [valid, setValid] = useState(true); @@ -141,7 +143,7 @@ const MovieDetailView: FunctionComponent<Props> = ({ match }) => { <ItemOverview item={item} details={[]}></ItemOverview> </Row> <Row> - <Table movie={item}></Table> + <Table movie={item} profile={profile}></Table> </Row> <ItemEditorModal modalKey="edit" diff --git a/frontend/src/Movies/Detail/table.tsx b/frontend/src/Movies/Detail/table.tsx index a50b9c82b..41f9554c9 100644 --- a/frontend/src/Movies/Detail/table.tsx +++ b/frontend/src/Movies/Detail/table.tsx @@ -107,6 +107,9 @@ const Table: FunctionComponent<Props> = ({ movie, profile }) => { return item; }); + console.log(movie.subtitles); + console.log(profileItems); + let raw_subtitles = movie.subtitles; if (onlyDesired) { raw_subtitles = intersectionWith( @@ -116,6 +119,8 @@ const Table: FunctionComponent<Props> = ({ movie, profile }) => { ); } + console.log(raw_subtitles); + return [...raw_subtitles, ...missing]; }, [movie.missing_subtitles, movie.subtitles, onlyDesired, profileItems]); |