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) {
449449 english
450450 native
451451 }
452 status
452453 }
453454 status
454455 score
@@ -489,6 +490,7 @@ func GetUserDataPreview(token string, userID int) (map[string]interface{}, error
489490 english
490491 native
491492 }
493 status
492494 }
493495 status
494496 score
@@ -779,6 +781,7 @@ func ParseAnimeList(input map[string]interface{}) AnimeList {
779781 Romaji: safeString(media["title"].(map[string]interface{})["romaji"]),
780782 Japanese: safeString(media["title"].(map[string]interface{})["native"]),
781783 },
784 Status: safeString(media["status"]),
782785 },
783786 Progress: toInt(entryData["progress"]),
784787 Score: entryData["score"].(float64),
internal/curd.go +3 −2
@@ -964,6 +964,7 @@ func SetupCurd(userCurdConfig *CurdConfig, anime *Anime, user *User, databaseAni
964964 // Set anime entry
965965 anime.Title = selectedAnilistAnime.Media.Title
966966 anime.TotalEpisodes = selectedAnilistAnime.Media.Episodes
967 anime.IsAiring = selectedAnilistAnime.Media.Status == "RELEASING" || selectedAnilistAnime.Media.Status == "NOT_YET_RELEASED"
967968 anime.Ep.Number = selectedAnilistAnime.Progress + 1
968969 var animeList []SelectionOption
969970 userQuery = anime.Title.Romaji
@@ -1644,7 +1645,7 @@ func StartNextEpisode(anime *Anime, userCurdConfig *CurdConfig, databaseFile str
16441645// HandleLastEpisodeCompletion handles scoring and completion for the last episode
16451646func HandleLastEpisodeCompletion(userCurdConfig *CurdConfig, anime *Anime, userToken string) {
16461647 // 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 {
16481649 // Prompt user to score the anime
16491650 CurdOut("You've completed this anime! Would you like to rate it?")
16501651
@@ -1670,7 +1671,7 @@ func HandleLastEpisodeCompletion(userCurdConfig *CurdConfig, anime *Anime, userT
16701671
16711672 // Update anime status to completed on AniList
16721673 // 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 {
16741675 err := UpdateAnimeStatus(userToken, anime.AnilistId, "COMPLETED")
16751676 if err != nil {
16761677 Log("Error updating anime status to completed: " + err.Error())
internal/structs.go +2 −1
@@ -95,6 +95,7 @@ type Media struct {
9595 Episodes int `json:"episodes"`
9696 ID int `json:"id"`
9797 Title AnimeTitle `json:"title"`
98 Status string `json:"status"`
9899}
99100
100101type Entry struct {
@@ -129,4 +130,4 @@ type SelectionOptionImage struct {
129130type SelectionOption struct {
130131 Label string
131132 Key string
132}
\ No newline at end of file
133}