Delete on completed and fetch on hold

This commit is contained in:
daru
2022-05-18 21:29:46 +02:00
parent be1419bfa7
commit 95294eb344
3 changed files with 47 additions and 35 deletions

View File

@@ -549,7 +549,13 @@ func processUpdateReq(ctx *fasthttp.RequestCtx, update bool) {
if update {
// anime exitsts => save
// get watch progress
progress, updated, _ := FetchProgress(anime.Anime, userId, username, 0)
progress, updated, listState, _ := FetchProgress(anime.Anime, userId, username, 0)
// anime is already completed big baka user
if listState == malApiStatusC {
ctx.WriteString("Du hast schon fertig geschaut bro")
ctx.SetStatusCode(fasthttp.StatusConflict)
return
}
animeData, err = AddUserToAnime(username, userId, anime.Anime, progress, updated)
} else {
// anime exitsts => delete