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 english 449 english
450 native 450 native
451 } 451 }
452 status
452 } 453 }
453 status 454 status
454 score 455 score
@@ -489,6 +490,7 @@ func GetUserDataPreview(token string, userID int) (map[string]interface{}, error
489 english 490 english
490 native 491 native
491 } 492 }
493 status
492 } 494 }
493 status 495 status
494 score 496 score
@@ -779,6 +781,7 @@ func ParseAnimeList(input map[string]interface{}) AnimeList {
779 Romaji: safeString(media["title"].(map[string]interface{})["romaji"]), 781 Romaji: safeString(media["title"].(map[string]interface{})["romaji"]),
780 Japanese: safeString(media["title"].(map[string]interface{})["native"]), 782 Japanese: safeString(media["title"].(map[string]interface{})["native"]),
781 }, 783 },
784 Status: safeString(media["status"]),
782 }, 785 },
783 Progress: toInt(entryData["progress"]), 786 Progress: toInt(entryData["progress"]),
784 Score: entryData["score"].(float64), 787 Score: entryData["score"].(float64),
internal/curd.go +3 −2
@@ -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
1645func HandleLastEpisodeCompletion(userCurdConfig *CurdConfig, anime *Anime, userToken string) { 1646func 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())
internal/structs.go +2 −1
@@ -95,6 +95,7 @@ type Media struct {
95 Episodes int `json:"episodes"` 95 Episodes int `json:"episodes"`
96 ID int `json:"id"` 96 ID int `json:"id"`
97 Title AnimeTitle `json:"title"` 97 Title AnimeTitle `json:"title"`
98 Status string `json:"status"`
98} 99}
99 100
100type Entry struct { 101type Entry struct {
@@ -129,4 +130,4 @@ type SelectionOptionImage struct {
129type SelectionOption struct { 130type SelectionOption struct {
130 Label string 131 Label string
131 Key string 132 Key string
132}\ No newline at end of file 133}