mirror of https://github.com/morpheus65535/bazarr
Fix an issue that cause subtitles missing in movie page
This commit is contained in:
parent
a417f35856
commit
b4037442b1
|
@ -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"
|
||||
|
|
|
@ -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]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue