mirror of
https://github.com/navidrome/navidrome.git
synced 2026-12-06 04:05:18 +03:00
Playlists support (99%) complete!
This commit is contained in:
1 parent
a27803a4d1
commit
b9952bc3de
7 files changed
+110
-8
No files matched your search
@@ -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