Fully working sonarr integration

This commit is contained in:
Aleksi Lassila
2023-07-24 00:19:39 +03:00
parent 51a7ab630a
commit 77153a96c5
20 changed files with 355 additions and 385 deletions

View File

@@ -1,17 +1,20 @@
import { writable } from 'svelte/store';
const initialValue = { visible: false, jellyfinId: '' };
export const playerState = writable(initialValue);
export const initialPlayerState = {
playerState,
close: () => {
playerState.set({ visible: false, jellyfinId: '' });
},
streamJellyfinId: (id: string) => {
playerState.set({ visible: true, jellyfinId: id });
}
};
export type PlayerState = typeof initialPlayerState;
export type PlayerStateValue = typeof initialValue;
function createPlayerState() {
const store = writable<PlayerStateValue>(initialValue);
return {
...store,
streamJellyfinId: (id: string) => {
store.set({ visible: true, jellyfinId: id });
},
close: () => {
store.set({ visible: false, jellyfinId: '' });
}
};
}
export const playerState = createPlayerState();