From a99437b4ccf8aa0ea7722a02bc500e50c57dfc00 Mon Sep 17 00:00:00 2001 From: zisra <100528712+zisra@users.noreply.github.com> Date: Tue, 21 Feb 2023 15:07:40 -0600 Subject: [PATCH] Fix title --- public/config.js | 2 +- src/video/components/actions/DownloadAction.tsx | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/public/config.js b/public/config.js index 3353b015..eb936081 100644 --- a/public/config.js +++ b/public/config.js @@ -1,6 +1,6 @@ window.__CONFIG__ = { // url must NOT end with a slash - VITE_CORS_PROXY_URL: "https://rough.isra.workers.dev", + VITE_CORS_PROXY_URL: "", VITE_TMDB_API_KEY: "b030404650f279792a8d3287232358e3", VITE_OMDB_API_KEY: "aa0937c0", diff --git a/src/video/components/actions/DownloadAction.tsx b/src/video/components/actions/DownloadAction.tsx index bffca2e1..10d59ce5 100644 --- a/src/video/components/actions/DownloadAction.tsx +++ b/src/video/components/actions/DownloadAction.tsx @@ -5,8 +5,7 @@ import { MWStreamType } from "@/backend/helpers/streams"; import { normalizeTitle } from "@/utils/normalizeTitle"; import { useIsMobile } from "@/hooks/useIsMobile"; import { useTranslation } from "react-i18next"; - -import { useCurrentSeriesEpisodeInfo } from "../hooks/useCurrentSeriesEpisodeInfo"; +import { useMeta } from "@/video/state/logic/meta"; import { VideoPlayerIconButton } from "../parts/VideoPlayerIconButton"; interface Props { @@ -16,25 +15,20 @@ interface Props { export function DownloadAction(props: Props) { const descriptor = useVideoPlayerDescriptor(); const sourceInterface = useSource(descriptor); - const { isSeries, humanizedEpisodeId, meta } = - useCurrentSeriesEpisodeInfo(descriptor); const { isMobile } = useIsMobile(); const { t } = useTranslation(); + const meta = useMeta(descriptor); - /* if (!meta) return null; - - const title = isSeries - ? `${meta?.meta.title} - ${humanizedEpisodeId}` - : meta?.meta.title; - */ const isHLS = sourceInterface.source?.type === MWStreamType.HLS; + const title = meta?.meta.meta.title; + return (