Commit 1fa06e48a2

1fa06e48a23049a05056d4d35782fd66d06dcbbf

parent: cb2f217426

Unregistered key

SsubezZ <119054422+SsubezZ@users.noreply.github.com> · 2025-02-09 15:51 UTC
committer: <noreply@github.com>

NextEpisodePrompt: remove "No" option(Quit alr there so) and Quit mpv when selecting anything than "Yes" (#38)

* nextepisodeprompt: remove 'no' because quit is already there

* nextepisodeprompt: quit mpv when not selecting yes

Layout: unified · split

cmd/curd/main.go +7 −7
@@ -543,17 +543,17 @@ func main() {
543543 if userCurdConfig.NextEpisodePrompt {
544544 internal.CurdOut(fmt.Sprintf("Start next episode (%d)?", anime.Ep.Number))
545545
546 options := map[string]string{
547 "yes": "Yes",
548 "no": "No",
549 }
550
551 selectedOption, err := internal.DynamicSelect(options, false)
546 selectedOption, err := internal.DynamicSelect(map[string]string{"yes": "Yes"}, false)
552547 if err != nil {
553548 internal.ExitCurd(err)
554549 }
555550
556 if selectedOption.Key == "no" || selectedOption.Key == "-1" {
551 if selectedOption.Key != "yes" {
552 // Send command to close MPV
553 _, err := internal.MPVSendCommand(anime.Ep.Player.SocketPath, []interface{}{"quit"})
554 if err != nil {
555 internal.Log("Error closing MPV: "+err.Error(), logFile)
556 }
557557 internal.ExitCurd(nil)
558558 }
559559 // If yes or any other case, continue with the next episode