Commit d8688ad89b
Unsigned
Layout: unified · split
internal/curd.go +12 −14
| @@ -1653,10 +1653,7 @@ func HandleLastEpisodeCompletion(userCurdConfig *CurdConfig, anime *Anime, userT | |||
| 1653 | selectedOption, err := DynamicSelect(scoreOptions) | 1653 | selectedOption, err := DynamicSelect(scoreOptions) |
| 1654 | if err != nil { | 1654 | if err != nil { |
| 1655 | Log(fmt.Sprintf("Error in score prompt selection: %v", err)) | 1655 | Log(fmt.Sprintf("Error in score prompt selection: %v", err)) |
| 1656 | return | 1656 | } else if selectedOption.Key == "yes" { |
| 1657 | } | ||
| 1658 | |||
| 1659 | if selectedOption.Key == "yes" { | ||
| 1660 | err = RateAnime(userToken, anime.AnilistId) | 1657 | err = RateAnime(userToken, anime.AnilistId) |
| 1661 | if err != nil { | 1658 | if err != nil { |
| 1662 | Log(fmt.Sprintf("Error rating anime: %v", err)) | 1659 | Log(fmt.Sprintf("Error rating anime: %v", err)) |
| @@ -1666,17 +1663,18 @@ func HandleLastEpisodeCompletion(userCurdConfig *CurdConfig, anime *Anime, userT | |||
| 1666 | } | 1663 | } |
| 1667 | } | 1664 | } |
| 1668 | // Back (-2) and no are treated as skip | 1665 | // Back (-2) and no are treated as skip |
| 1666 | } | ||
| 1669 | 1667 | ||
| 1670 | // Update anime status to completed on AniList | 1668 | // Update anime status to completed on AniList |
| 1671 | if !anime.Rewatching { | 1669 | // This is done regardless of scoring preference |
| 1672 | go func() { | 1670 | if anime.TotalEpisodes > 0 && anime.Ep.Number == anime.TotalEpisodes && !anime.Rewatching { |
| 1673 | err := UpdateAnimeStatus(userToken, anime.AnilistId, "COMPLETED") | 1671 | go func() { |
| 1674 | if err != nil { | 1672 | err := UpdateAnimeStatus(userToken, anime.AnilistId, "COMPLETED") |
| 1675 | Log("Error updating anime status to completed: " + err.Error()) | 1673 | if err != nil { |
| 1676 | } | 1674 | Log("Error updating anime status to completed: " + err.Error()) |
| 1677 | // Note: UpdateAnimeStatus already outputs a message on success | 1675 | } |
| 1678 | }() | 1676 | // Note: UpdateAnimeStatus already outputs a message on success |
| 1679 | } | 1677 | }() |
| 1680 | } | 1678 | } |
| 1681 | 1679 | ||
| 1682 | // Check for sequel after completion (only if this is the last episode) | 1680 | // Check for sequel after completion (only if this is the last episode) |