const [mainParentFolder] = createResource(folderPath, get_os_folder_by_path); const [osVideos, { mutate }] = createResource( () => mainParentFolder() ? mainParentFolder()?.path : null, get_os_videos );
onClick={() => { let newVideo = structuredClone(video); newVideo.watched = !video.watched; update_os_videos([newVideo]).then(() => { mutate((videos) => { return videos?.map((vid) => vid.path === newVideo.path ? newVideo : vid) || []; }); });}}