mirror of
https://github.com/movie-web/movie-web.git
synced 2025-01-13 14:39:08 +01:00
Add methods to directly set progress and bookmark items
This commit is contained in:
parent
558c6431fd
commit
a642abc783
@ -26,6 +26,7 @@ export interface BookmarkStore {
|
||||
bookmarks: Record<string, BookmarkMediaItem>;
|
||||
updateQueue: BookmarkUpdateItem[];
|
||||
addBookmark(meta: PlayerMeta): void;
|
||||
setBookmark(id: string, item: BookmarkMediaItem): void;
|
||||
removeBookmark(id: string): void;
|
||||
replaceBookmarks(items: Record<string, BookmarkMediaItem>): void;
|
||||
clear(): void;
|
||||
@ -94,6 +95,11 @@ export const useBookmarkStore = create(
|
||||
s.updateQueue = [...s.updateQueue.filter((v) => v.id !== id)];
|
||||
});
|
||||
},
|
||||
setBookmark(id, item) {
|
||||
set((s) => {
|
||||
s.bookmarks[id] = item;
|
||||
});
|
||||
},
|
||||
})),
|
||||
{
|
||||
name: "__MW::bookmarks",
|
||||
|
@ -64,6 +64,7 @@ export interface ProgressStore {
|
||||
clear(): void;
|
||||
clearUpdateQueue(): void;
|
||||
removeUpdateItem(id: string): void;
|
||||
setItem(id: string, item: ProgressMediaItem): void;
|
||||
}
|
||||
|
||||
let updateId = 0;
|
||||
@ -173,6 +174,11 @@ export const useProgressStore = create(
|
||||
s.updateQueue = [...s.updateQueue.filter((v) => v.id !== id)];
|
||||
});
|
||||
},
|
||||
setItem(id, item) {
|
||||
set((s) => {
|
||||
s.items[id] = item;
|
||||
});
|
||||
},
|
||||
})),
|
||||
{
|
||||
name: "__MW::progress",
|
||||
|
Loading…
x
Reference in New Issue
Block a user