Commit dab28c5413

dab28c54135051bff847f32495349ead45fd4476

parent: f9505924b1

Unsigned

Wraient <wraient.911@gmail.com> · 2025-07-23 18:17 UTC

Fix: Next Episode Prompt

Layout: unified · split

internal/curd.go +27
@@ -1050,6 +1050,33 @@ func SetupCurd(userCurdConfig *CurdConfig, anime *Anime, user *User, databaseAni
1050 if userCurdConfig.NextEpisodePrompt && anime.TotalEpisodes > 0 && anime.Ep.Number == anime.TotalEpisodes && !userCurdConfig.RofiSelection { 1050 if userCurdConfig.NextEpisodePrompt && anime.TotalEpisodes > 0 && anime.Ep.Number == anime.TotalEpisodes && !userCurdConfig.RofiSelection {
1051 // Ensure the terminal state is clean for the prompt 1051 // Ensure the terminal state is clean for the prompt
1052 fmt.Print("\r\033[K") // Carriage return and clear line 1052 fmt.Print("\r\033[K") // Carriage return and clear line
1053 episodeNum := anime.Ep.Number
1054 if !userCurdConfig.RofiSelection {
1055 episodeNum++
1056 }
1057
1058 CurdOut(fmt.Sprintf("Start next episode (%d)?", episodeNum))
1059
1060 // Create options for the selection
1061 options := []SelectionOption{
1062 {Key: "yes", Label: "Yes, start next episode"},
1063 // "no": "No, quit",
1064 }
1065
1066 // Use DynamicSelect for both CLI and Rofi modes
1067 selectedOption, err := DynamicSelect(options)
1068 if err != nil {
1069 ExitCurd(err)
1070 }
1071
1072 if selectedOption.Key == "-1" {
1073 // User selected to quit
1074 fmt.Print("\r\033[K") // Carriage return and clear line
1075 ExitMPV(anime.Ep.Player.SocketPath)
1076 CurdOut("Exiting without starting next episode")
1077 ExitCurd(nil)
1078 return
1079 }
1053 } 1080 }
1054} 1081}
1055 1082