rate-current CLI option (#847)

This commit is contained in:
Drew Weymouth
2026-02-07 10:18:51 -08:00
committed by GitHub
parent 3c46889014
commit b52aa5b36f
5 changed files with 54 additions and 3 deletions
+11 -1
View File
@@ -12,6 +12,7 @@ import (
var (
VolumeCLIArg int = -1
SeekToCLIArg float64 = -1
RateCurrentCLIArg int = -1
SeekByCLIArg float64 = 0
VolumePctCLIArg float64 = 0
PlayAlbumCLIArg string = ""
@@ -84,7 +85,9 @@ func init() {
}
flag.Func("first-track", "start playing from given track (positive integer, to be used with either -play-album or -play-playlist)", func(s string) error {
v, err := strconv.Atoi(s)
FirstTrackCLIArg = v
if err == nil {
FirstTrackCLIArg = v
}
return err
})
@@ -100,6 +103,13 @@ func init() {
SearchTrackCLIArg = s
return nil
})
flag.Func("rate-current", "rate the current track with the given rating (0-5)", func(s string) error {
v, err := strconv.Atoi(s)
if err == nil {
RateCurrentCLIArg = v
}
return err
})
}
func HaveCommandLineOptions() bool {