34 files changed
+2910
-300
No files matched your search
@@ -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 = (
|
||||
|
||||
@@ -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,4 +1,3 @@
|
||||
import { create } from "zustand";
|
||||
import { shallow } from "zustand/shallow";
|
||||
import { createWithEqualityFn } from "zustand/traditional";
|
||||
|
||||
|
||||
Reference in new issue
Block a user