| @@ -964,6 +964,7 @@ func SetupCurd(userCurdConfig *CurdConfig, anime *Anime, user *User, databaseAni |
| 964 | // Set anime entry |
964 | // Set anime entry |
| 965 | anime.Title = selectedAnilistAnime.Media.Title |
965 | anime.Title = selectedAnilistAnime.Media.Title |
| 966 | anime.TotalEpisodes = selectedAnilistAnime.Media.Episodes |
966 | anime.TotalEpisodes = selectedAnilistAnime.Media.Episodes |
| |
967 | anime.IsAiring = selectedAnilistAnime.Media.Status == "RELEASING" || selectedAnilistAnime.Media.Status == "NOT_YET_RELEASED" |
| 967 | anime.Ep.Number = selectedAnilistAnime.Progress + 1 |
968 | anime.Ep.Number = selectedAnilistAnime.Progress + 1 |
| 968 | var animeList []SelectionOption |
969 | var animeList []SelectionOption |
| 969 | userQuery = anime.Title.Romaji |
970 | userQuery = anime.Title.Romaji |
| @@ -1644,7 +1645,7 @@ func StartNextEpisode(anime *Anime, userCurdConfig *CurdConfig, databaseFile str |
| 1644 | // HandleLastEpisodeCompletion handles scoring and completion for the last episode |
1645 | // HandleLastEpisodeCompletion handles scoring and completion for the last episode |
| 1645 | func HandleLastEpisodeCompletion(userCurdConfig *CurdConfig, anime *Anime, userToken string) { |
1646 | func HandleLastEpisodeCompletion(userCurdConfig *CurdConfig, anime *Anime, userToken string) { |
| 1646 | // Check if this is the last episode and scoring is enabled |
1647 | // Check if this is the last episode and scoring is enabled |
| 1647 | if userCurdConfig.ScoreOnCompletion && anime.TotalEpisodes > 0 && anime.Ep.Number == anime.TotalEpisodes { |
1648 | if userCurdConfig.ScoreOnCompletion && anime.TotalEpisodes > 0 && anime.Ep.Number == anime.TotalEpisodes && !anime.IsAiring { |
| 1648 | // Prompt user to score the anime |
1649 | // Prompt user to score the anime |
| 1649 | CurdOut("You've completed this anime! Would you like to rate it?") |
1650 | CurdOut("You've completed this anime! Would you like to rate it?") |
| 1650 | |
1651 | |
| @@ -1670,7 +1671,7 @@ func HandleLastEpisodeCompletion(userCurdConfig *CurdConfig, anime *Anime, userT |
| 1670 | |
1671 | |
| 1671 | // Update anime status to completed on AniList |
1672 | // Update anime status to completed on AniList |
| 1672 | // This is done regardless of scoring preference |
1673 | // This is done regardless of scoring preference |
| 1673 | if anime.TotalEpisodes > 0 && anime.Ep.Number == anime.TotalEpisodes && !anime.Rewatching { |
1674 | if anime.TotalEpisodes > 0 && anime.Ep.Number == anime.TotalEpisodes && !anime.Rewatching && !anime.IsAiring { |
| 1674 | err := UpdateAnimeStatus(userToken, anime.AnilistId, "COMPLETED") |
1675 | err := UpdateAnimeStatus(userToken, anime.AnilistId, "COMPLETED") |
| 1675 | if err != nil { |
1676 | if err != nil { |
| 1676 | Log("Error updating anime status to completed: " + err.Error()) |
1677 | Log("Error updating anime status to completed: " + err.Error()) |