Commit 003fe6999a

003fe6999aa857fd484094ccf43a5f7d37c90694

parent: 03e3d9dda2

Unsigned

Wraient <wraient.911@gmail.com> · 2026-01-05 08:47 UTC

Fix: Last episode does not need concurrency

Layout: unified · split

internal/curd.go +10 −14
@@ -1577,13 +1577,11 @@ func StartNextEpisode(anime *Anime, userCurdConfig *CurdConfig, databaseFile str
1577 1577
1578 // Update Anilist progress for the last episode if not rewatching 1578 // Update Anilist progress for the last episode if not rewatching
1579 if !anime.Rewatching { 1579 if !anime.Rewatching {
1580 go func() { 1580 err := UpdateAnimeProgress(userToken, anime.AnilistId, prevEpisode)
1581 err := UpdateAnimeProgress(userToken, anime.AnilistId, prevEpisode) 1581 if err != nil {
1582 if err != nil { 1582 Log("Error updating Anilist progress: " + err.Error())
1583 Log("Error updating Anilist progress: " + err.Error()) 1583 }
1584 } 1584 // Note: UpdateAnimeProgress already outputs a message on success
1585 // Note: UpdateAnimeProgress already outputs a message on success
1586 }()
1587 } 1585 }
1588 1586
1589 CurdOut("Series completed!") 1587 CurdOut("Series completed!")
@@ -1668,13 +1666,11 @@ func HandleLastEpisodeCompletion(userCurdConfig *CurdConfig, anime *Anime, userT
1668 // Update anime status to completed on AniList 1666 // Update anime status to completed on AniList
1669 // This is done regardless of scoring preference 1667 // This is done regardless of scoring preference
1670 if anime.TotalEpisodes > 0 && anime.Ep.Number == anime.TotalEpisodes && !anime.Rewatching { 1668 if anime.TotalEpisodes > 0 && anime.Ep.Number == anime.TotalEpisodes && !anime.Rewatching {
1671 go func() { 1669 err := UpdateAnimeStatus(userToken, anime.AnilistId, "COMPLETED")
1672 err := UpdateAnimeStatus(userToken, anime.AnilistId, "COMPLETED") 1670 if err != nil {
1673 if err != nil { 1671 Log("Error updating anime status to completed: " + err.Error())
1674 Log("Error updating anime status to completed: " + err.Error()) 1672 }
1675 } 1673 // Note: UpdateAnimeStatus already outputs a message on success
1676 // Note: UpdateAnimeStatus already outputs a message on success
1677 }()
1678 } 1674 }
1679 1675
1680 // Check for sequel after completion (only if this is the last episode) 1676 // Check for sequel after completion (only if this is the last episode)