Commit 7b8800f0b5
7b8800f0b5c94b6449d151d6428a694b11f2d91b
parent: bf78e28bfb
Unsigned
Wraient <wraient.911@gmail.com> · 2026-01-07 20:30 UTC
Feat: If anime is airing do not ask to rate it
Layout: unified · split
internal/anilist.go
+3
| @@ -449,6 +449,7 @@ func GetUserData(token string, userID int) (map[string]interface{}, error) { |
| 449 | 449 | english |
| 450 | 450 | native |
| 451 | 451 | } |
| 452 | status |
| 452 | 453 | } |
| 453 | 454 | status |
| 454 | 455 | score |
| @@ -489,6 +490,7 @@ func GetUserDataPreview(token string, userID int) (map[string]interface{}, error |
| 489 | 490 | english |
| 490 | 491 | native |
| 491 | 492 | } |
| 493 | status |
| 492 | 494 | } |
| 493 | 495 | status |
| 494 | 496 | score |
| @@ -779,6 +781,7 @@ func ParseAnimeList(input map[string]interface{}) AnimeList { |
| 779 | 781 | Romaji: safeString(media["title"].(map[string]interface{})["romaji"]), |
| 780 | 782 | Japanese: safeString(media["title"].(map[string]interface{})["native"]), |
| 781 | 783 | }, |
| 784 | Status: safeString(media["status"]), |
| 782 | 785 | }, |
| 783 | 786 | Progress: toInt(entryData["progress"]), |
| 784 | 787 | Score: entryData["score"].(float64), |
internal/curd.go
+3 −2
| @@ -964,6 +964,7 @@ func SetupCurd(userCurdConfig *CurdConfig, anime *Anime, user *User, databaseAni |
| 964 | 964 | // Set anime entry |
| 965 | 965 | anime.Title = selectedAnilistAnime.Media.Title |
| 966 | 966 | anime.TotalEpisodes = selectedAnilistAnime.Media.Episodes |
| 967 | anime.IsAiring = selectedAnilistAnime.Media.Status == "RELEASING" || selectedAnilistAnime.Media.Status == "NOT_YET_RELEASED" |
| 967 | 968 | anime.Ep.Number = selectedAnilistAnime.Progress + 1 |
| 968 | 969 | var animeList []SelectionOption |
| 969 | 970 | userQuery = anime.Title.Romaji |
| @@ -1644,7 +1645,7 @@ func StartNextEpisode(anime *Anime, userCurdConfig *CurdConfig, databaseFile str |
| 1644 | 1645 | // HandleLastEpisodeCompletion handles scoring and completion for the last episode |
| 1645 | 1646 | func HandleLastEpisodeCompletion(userCurdConfig *CurdConfig, anime *Anime, userToken string) { |
| 1646 | 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 | 1649 | // Prompt user to score the anime |
| 1649 | 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 | 1672 | // Update anime status to completed on AniList |
| 1672 | 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 | 1675 | err := UpdateAnimeStatus(userToken, anime.AnilistId, "COMPLETED") |
| 1675 | 1676 | if err != nil { |
| 1676 | 1677 | Log("Error updating anime status to completed: " + err.Error()) |
internal/structs.go
+2 −1
| @@ -95,6 +95,7 @@ type Media struct { |
| 95 | 95 | Episodes int `json:"episodes"` |
| 96 | 96 | ID int `json:"id"` |
| 97 | 97 | Title AnimeTitle `json:"title"` |
| 98 | Status string `json:"status"` |
| 98 | 99 | } |
| 99 | 100 | |
| 100 | 101 | type Entry struct { |
| @@ -129,4 +130,4 @@ type SelectionOptionImage struct { |
| 129 | 130 | type SelectionOption struct { |
| 130 | 131 | Label string |
| 131 | 132 | Key string |
| 132 | | } |
| \ No newline at end of file |
| 133 | } |