Commit 65fb4270ab

65fb4270abf48b75c7a8ba044691193edda81c15

parent: f5dbaf1620

Unregistered key

Frostedfox <84601232+Frostedfox@users.noreply.github.com> · 2026-01-04 12:58 UTC
committer: <noreply@github.com>

fix for portable mpv (#78)

Co-authored-by: vgsrivathsan <vgsrivathsan@gmail.com>

Layout: unified · split

internal/player.go +9 −3
@@ -11,6 +11,7 @@ import (
11 "strings" 11 "strings"
12 "sync" 12 "sync"
13 "time" 13 "time"
14 "errors"
14) 15)
15 16
16var logFile = "debug.log" 17var logFile = "debug.log"
@@ -114,9 +115,14 @@ func StartVideo(link string, args []string, title string, anime *Anime) (string,
114 return "", err 115 return "", err
115 } 116 }
116 117
117 // Create command for Windows 118 if _, err := os.Stat(mpvPath); err == nil {
118 command = exec.Command(mpvPath, mpvArgs...) 119 command = exec.Command(mpvPath, mpvArgs...)
119 } else { 120
121 } else if errors.Is(err, os.ErrNotExist) {
122 //for windows with mpv on PATH
123 command = exec.Command("mpv", mpvArgs...)
124
125 } else {
120 // Create command for Unix-like systems 126 // Create command for Unix-like systems
121 command = exec.Command("mpv", mpvArgs...) 127 command = exec.Command("mpv", mpvArgs...)
122 } 128 }