Project refactoring

This commit is contained in:
Aleksi Lassila
2024-03-02 00:52:01 +02:00
parent 1c1fbbf043
commit 27b9fc57b3
94 changed files with 128 additions and 102 deletions

View File

@@ -1,25 +0,0 @@
import { writable } from 'svelte/store';
import { modalStack } from '../../stores/modal.store';
import VideoPlayer from './VideoPlayer.svelte';
import { jellyfinItemsStore } from '../../stores/data.store';
const initialValue = { visible: false, jellyfinId: '' };
export type PlayerStateValue = typeof initialValue;
function createPlayerState() {
const store = writable<PlayerStateValue>(initialValue);
return {
...store,
streamJellyfinId: (id: string) => {
store.set({ visible: true, jellyfinId: id });
modalStack.create(VideoPlayer, {}); // FIXME
},
close: () => {
store.set({ visible: false, jellyfinId: '' });
jellyfinItemsStore.refresh();
}
};
}
export const playerState = createPlayerState();