mirror of
https://github.com/navidrome/navidrome.git
synced 2025-08-10 00:52:20 +00:00
Playlists support (99%) complete!
This commit is contained in:
@@ -39,6 +39,10 @@ func (c *BaseAPIController) ParamString(param string) string {
|
||||
return c.Input().Get(param)
|
||||
}
|
||||
|
||||
func (c *BaseAPIController) ParamStrings(param string) []string {
|
||||
return c.Input()[param]
|
||||
}
|
||||
|
||||
func (c *BaseAPIController) ParamTime(param string, def time.Time) time.Time {
|
||||
var value int64
|
||||
if c.Input().Get(param) == "" {
|
||||
@@ -74,6 +78,18 @@ func (c *BaseAPIController) ParamInt(param string, def int) int {
|
||||
return value
|
||||
}
|
||||
|
||||
func (c *BaseAPIController) ParamInts(param string) []int {
|
||||
pStr := c.Input()[param]
|
||||
ints := make([]int, 0, len(pStr))
|
||||
for _, s := range pStr {
|
||||
i, err := strconv.ParseInt(s, 10, 32)
|
||||
if err == nil {
|
||||
ints = append(ints, int(i))
|
||||
}
|
||||
}
|
||||
return ints
|
||||
}
|
||||
|
||||
func (c *BaseAPIController) ParamBool(param string, def bool) bool {
|
||||
value := def
|
||||
if c.Input().Get(param) == "" {
|
||||
|
||||
Reference in New Issue
Block a user