feat: implement basic image viewer #338 #240

This commit is contained in:
Prayag Prajapati committed 2024-10-04 19:17:10 +05:30
1 parent a1bb8f8e23
commit 3f6bdb392f
34 files changed
+2910 -300

No files matched your search

-3
View File
@@ -37,8 +37,6 @@ export const playAudio = (
url: string,
item: BaseItemDto | undefined | null,
playlistItemId: string | undefined,
queue: BaseItemDto[] | undefined,
queueItemIndex: number,
): void => {
useAudioPlayback.setState({
display: true,
@@ -46,7 +44,6 @@ export const playAudio = (
item,
playlistItemId,
});
setQueue(queue, queueItemIndex);
};
export const generateAudioStreamUrl = (
+32
View File
@@ -0,0 +1,32 @@
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
import { create } from "zustand";
import { devtools } from "zustand/middleware";
import { immer } from "zustand/middleware/immer";
import { shallow } from "zustand/shallow";
import { createWithEqualityFn } from "zustand/traditional";
import { usePlaybackStore } from "./playback";
type PhotosPlaybackStore = {
photos: BaseItemDto[] | null;
index: number;
playPhotos: (photos: BaseItemDto[], index: number) => void;
};
type PhotosPlaybackStoreActions = {
playPhotos: (photos: BaseItemDto[]) => void;
};
export const usePhotosPlayback = createWithEqualityFn<PhotosPlaybackStore>()(
devtools(
immer((set) => ({
photos: null,
playPhotos: (photos, index) =>
set((state) => {
state.photos = photos;
state.index = index;
}),
index: 0,
})),
),
shallow,
);
-1
View File
@@ -1,4 +1,3 @@
import { create } from "zustand";
import { shallow } from "zustand/shallow";
import { createWithEqualityFn } from "zustand/traditional";
+2 -2
View File
@@ -5,8 +5,8 @@ import type {
import type IntroMediaInfo from "./introMediaInfo";
interface PlayResult {
item: BaseItemDtoQueryResult;
mediaSource: PlaybackInfoResponse;
item: BaseItemDtoQueryResult | undefined;
mediaSource: PlaybackInfoResponse | undefined;
introInfo: IntroMediaInfo | undefined;
}