updated table when entries are deleted and fixed simkl watchlist

This commit is contained in:
2024-09-18 15:06:35 -04:00
parent 77dc48fcf2
commit 572366eb91
2 changed files with 82 additions and 4 deletions

View File

@ -290,9 +290,51 @@
const deleteEntries = async () => {
submitting.set(true)
if (isAniListLoggedIn && currentAniListAnime.data.MediaList.mediaId !== 0) await AniListDeleteEntry(currentAniListAnime.data.MediaList.id)
if (malLoggedIn && currentMalAnime.id !== 0) await DeleteMyAnimeListEntry(currentMalAnime.id)
if (simklLoggedIn && currentSimklAnime.show.ids.simkl !== 0) await SimklSyncRemove(currentSimklAnime)
if (isAniListLoggedIn && currentAniListAnime.data.MediaList.mediaId !== 0) {
await AniListDeleteEntry(currentAniListAnime.data.MediaList.id)
AddAnimeServiceToTable({
id: currentAniListAnime.data.MediaList.mediaId,
title,
service: "AniList",
progress: 0,
status: "",
startedAt: "",
completedAt: "",
score: 0,
repeat: 0,
notes: "",
})
}
if (malLoggedIn && currentMalAnime.id !== 0) {
await DeleteMyAnimeListEntry(currentMalAnime.id)
AddAnimeServiceToTable({
id: currentMalAnime.id,
title: currentMalAnime.title,
service: "MyAnimeList",
progress: 0,
status: "",
startedAt: "",
completedAt: "",
score: 0,
repeat: 0,
notes: "",
})
}
if (simklLoggedIn && currentSimklAnime.show.ids.simkl !== 0) {
await SimklSyncRemove(currentSimklAnime)
AddAnimeServiceToTable({
id: currentSimklAnime.show.ids.simkl,
title: currentSimklAnime.show.title,
service: "Simkl",
progress: 0,
status: "",
startedAt: "",
completedAt: "",
score: 0,
repeat: 0,
notes: "",
})
}
submitting.set(false)
submitSuccess.set(true)
setTimeout(() => submitSuccess.set(false), 2000)