From d51603a3827f04192b04bbf42fa5761ab70b1a98 Mon Sep 17 00:00:00 2001 From: frost768 Date: Wed, 22 Mar 2023 12:38:12 +0300 Subject: [PATCH 1/3] fix safari fullscreen --- src/video/components/VideoPlayerBase.tsx | 2 +- src/video/components/internal/VideoElementInternal.tsx | 2 +- src/video/state/providers/videoStateProvider.ts | 4 +++- src/views/developer/VideoTesterView.tsx | 6 +++--- src/views/media/MediaView.tsx | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/video/components/VideoPlayerBase.tsx b/src/video/components/VideoPlayerBase.tsx index 18f34ab0..82d91dac 100644 --- a/src/video/components/VideoPlayerBase.tsx +++ b/src/video/components/VideoPlayerBase.tsx @@ -39,7 +39,7 @@ function VideoPlayerBaseWithState(props: VideoPlayerBaseProps) {
); } diff --git a/src/video/state/providers/videoStateProvider.ts b/src/video/state/providers/videoStateProvider.ts index 4b085133..7ea0e321 100644 --- a/src/video/state/providers/videoStateProvider.ts +++ b/src/video/state/providers/videoStateProvider.ts @@ -277,7 +277,9 @@ export function createVideoStateProvider( updateMediaPlaying(descriptor, state); }; const fullscreenchange = () => { - state.interface.isFullscreen = !!document.fullscreenElement; + state.interface.isFullscreen = + !!document.fullscreenElement || // other browsers + !!(document as any).webkitFullscreenElement; // safari updateInterface(descriptor, state); }; const volumechange = async () => { diff --git a/src/views/developer/VideoTesterView.tsx b/src/views/developer/VideoTesterView.tsx index 7681af6e..e3ee84f4 100644 --- a/src/views/developer/VideoTesterView.tsx +++ b/src/views/developer/VideoTesterView.tsx @@ -50,7 +50,7 @@ export function VideoTesterView() { if (video) { return ( -
+
@@ -64,8 +64,8 @@ export function VideoTesterView() { />
diff --git a/src/views/media/MediaView.tsx b/src/views/media/MediaView.tsx index b674fb9f..bad662ff 100644 --- a/src/views/media/MediaView.tsx +++ b/src/views/media/MediaView.tsx @@ -132,7 +132,7 @@ export function MediaViewPlayer(props: MediaViewPlayerProps) { } return ( -
+
From 603e42b907c52f9627d3b0c7627ca0d29ce47a78 Mon Sep 17 00:00:00 2001 From: frost768 Date: Wed, 22 Mar 2023 12:51:51 +0300 Subject: [PATCH 2/3] remove unnecessary margin from slider --- src/setup/index.css | 1 - 1 file changed, 1 deletion(-) diff --git a/src/setup/index.css b/src/setup/index.css index aecde89f..e699aa1b 100644 --- a/src/setup/index.css +++ b/src/setup/index.css @@ -94,7 +94,6 @@ input[type=range].styled-slider::-webkit-slider-runnable-track { border: none; box-shadow: none; border-radius: var(--slider-border-radius); - margin-bottom: 1.1em; } input[type=range].styled-slider::-webkit-slider-thumb:hover { From 2f10de415bc5950769ba2c26dffddd36f9551e53 Mon Sep 17 00:00:00 2001 From: frost768 Date: Sun, 26 Mar 2023 10:44:16 +0300 Subject: [PATCH 3/3] add flixhq media type filter --- src/backend/providers/flixhq.ts | 21 ++++++++++----------- src/hooks/useSearchQuery.ts | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/backend/providers/flixhq.ts b/src/backend/providers/flixhq.ts index c2a1b84b..d9440213 100644 --- a/src/backend/providers/flixhq.ts +++ b/src/backend/providers/flixhq.ts @@ -10,12 +10,13 @@ import { MWMediaType } from "../metadata/types"; const flixHqBase = "https://api.consumet.org/meta/tmdb"; +type FlixHQMediaType = "Movie" | "TV Series"; interface FLIXMediaBase { id: number; title: string; url: string; image: string; - type: "Movie" | "TV Series"; + type: FlixHQMediaType; releaseDate: string; } @@ -38,9 +39,9 @@ const qualityMap: Record = { "1080": MWStreamQuality.Q1080P, }; -enum FlixHQMediaType { - MOVIE = "movie", - SERIES = "series", +function flixTypeToMWType(type: FlixHQMediaType) { + if (type === "Movie") return MWMediaType.MOVIE; + return MWMediaType.SERIES; } registerProvider({ @@ -48,7 +49,6 @@ registerProvider({ displayName: "FlixHQ", rank: 100, type: [MWMediaType.MOVIE, MWMediaType.SERIES], - async scrape({ media, episode, progress }) { if (!this.type.includes(media.meta.type)) { throw new Error("Unsupported type"); @@ -65,9 +65,11 @@ registerProvider({ if (v.type !== "Movie" && v.type !== "TV Series") return false; return ( compareTitle(v.title, media.meta.title) && + flixTypeToMWType(v.type) === media.meta.type && v.releaseDate === media.meta.year ); }); + if (!foundItem) throw new Error("No watchable item found"); // get media info @@ -75,15 +77,12 @@ registerProvider({ const mediaInfo = await proxiedFetch(`/info/${foundItem.id}`, { baseURL: flixHqBase, params: { - type: - media.meta.type === MWMediaType.MOVIE - ? FlixHQMediaType.MOVIE - : FlixHQMediaType.SERIES, + type: flixTypeToMWType(foundItem.type), }, }); if (!mediaInfo.id) throw new Error("No watchable item found"); // get stream info from media - progress(75); + progress(50); let episodeId: string | undefined; if (media.meta.type === MWMediaType.MOVIE) { @@ -98,7 +97,7 @@ registerProvider({ episodeId = season.episodes.find((o: any) => o.episode === episodeNo).id; } if (!episodeId) throw new Error("No watchable item found"); - + progress(75); const watchInfo = await proxiedFetch(`/watch/${episodeId}`, { baseURL: flixHqBase, params: { diff --git a/src/hooks/useSearchQuery.ts b/src/hooks/useSearchQuery.ts index 372c70fc..093a99c2 100644 --- a/src/hooks/useSearchQuery.ts +++ b/src/hooks/useSearchQuery.ts @@ -6,7 +6,7 @@ function getInitialValue(params: { type: string; query: string }) { const type = Object.values(MWMediaType).find((v) => params.type === v) || MWMediaType.MOVIE; - const searchQuery = params.query || ""; + const searchQuery = decodeURIComponent(params.query || ""); return { type, searchQuery }; }