|
|
|
@ -15,10 +15,12 @@ import {
@@ -15,10 +15,12 @@ import {
|
|
|
|
|
} from "@/backend/metadata/types/mw"; |
|
|
|
|
import { IconPatch } from "@/components/buttons/IconPatch"; |
|
|
|
|
import { Icons } from "@/components/Icon"; |
|
|
|
|
import { ErrorMessage } from "@/components/layout/ErrorBoundary"; |
|
|
|
|
import { Loading } from "@/components/layout/Loading"; |
|
|
|
|
import { useGoBack } from "@/hooks/useGoBack"; |
|
|
|
|
import { useLoading } from "@/hooks/useLoading"; |
|
|
|
|
import { SelectedMediaData, useScrape } from "@/hooks/useScrape"; |
|
|
|
|
import { conf } from "@/setup/config"; |
|
|
|
|
import { useWatchedItem } from "@/state/watched"; |
|
|
|
|
import { MetaController } from "@/video/components/controllers/MetaController"; |
|
|
|
|
import { ProgressListenerController } from "@/video/components/controllers/ProgressListenerController"; |
|
|
|
@ -53,6 +55,31 @@ function MediaViewLoading(props: { onGoBack(): void }) {
@@ -53,6 +55,31 @@ function MediaViewLoading(props: { onGoBack(): void }) {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function MediaVIewNotAllowed(props: { onGoBack(): void }) { |
|
|
|
|
const { t } = useTranslation(); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className="relative flex flex-1 items-center justify-center"> |
|
|
|
|
<Helmet> |
|
|
|
|
<title>{t("videoPlayer.got")}</title> |
|
|
|
|
</Helmet> |
|
|
|
|
<div className="absolute inset-x-0 top-0 px-8 py-6"> |
|
|
|
|
<VideoPlayerHeader onClick={props.onGoBack} /> |
|
|
|
|
</div> |
|
|
|
|
<div className="flex flex-col items-center"> |
|
|
|
|
<ErrorMessage |
|
|
|
|
error={{ |
|
|
|
|
name: "Media not allowed", |
|
|
|
|
description: |
|
|
|
|
"this movie is disabled on movie-web and will not be added.", |
|
|
|
|
path: "", |
|
|
|
|
}} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
interface MediaViewScrapingProps { |
|
|
|
|
onStream(stream: MWStream): void; |
|
|
|
|
onGoBack(): void; |
|
|
|
@ -240,6 +267,14 @@ export function MediaView() {
@@ -240,6 +267,14 @@ export function MediaView() {
|
|
|
|
|
}); |
|
|
|
|
}, [exec, history, params]); |
|
|
|
|
|
|
|
|
|
const disallowedEntries = conf().DISALLOWED_IDS.map((id) => id.split("-")); |
|
|
|
|
if ( |
|
|
|
|
disallowedEntries.find( |
|
|
|
|
(entry) => meta?.tmdbId === entry[1] && meta?.meta?.type === entry[0] |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
return <MediaVIewNotAllowed onGoBack={goBack} />; |
|
|
|
|
|
|
|
|
|
if (loading) return <MediaViewLoading onGoBack={goBack} />; |
|
|
|
|
if (error) return <MediaFetchErrorView />; |
|
|
|
|
if (!meta || !selected) |
|
|
|
|