Commit 65fb4270ab
Unregistered key
Layout: unified · split
internal/player.go +9 −3
| @@ -11,6 +11,7 @@ import ( | ||
| 11 | 11 | "strings" |
| 12 | 12 | "sync" |
| 13 | 13 | "time" |
| 14 | "errors" | |
| 14 | 15 | ) |
| 15 | 16 | |
| 16 | 17 | var logFile = "debug.log" |
| @@ -114,9 +115,14 @@ func StartVideo(link string, args []string, title string, anime *Anime) (string, | ||
| 114 | 115 | return "", err |
| 115 | 116 | } |
| 116 | 117 | |
| 117 | // Create command for Windows | |
| 118 | command = exec.Command(mpvPath, mpvArgs...) | |
| 119 | } else { | |
| 118 | if _, err := os.Stat(mpvPath); err == nil { | |
| 119 | command = exec.Command(mpvPath, mpvArgs...) | |
| 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 | 126 | // Create command for Unix-like systems |
| 121 | 127 | command = exec.Command("mpv", mpvArgs...) |
| 122 | 128 | } |