make musicFolderIds ints (#169)
* make `musicFolderId`s ints
https://github.com/sentriz/gonic/issues/50#issuecomment-963257103
006c1dafee/Classes/Models/API%20Models/MediaFolder.swift (L16)
related #50
* add a test for multi folders and reused artists
This commit is contained in:
@@ -30,6 +30,7 @@ type Controller struct {
|
||||
CachePath string
|
||||
CoverCachePath string
|
||||
PodcastsPath string
|
||||
MusicPaths []string
|
||||
Jukebox *jukebox.Jukebox
|
||||
Scrobblers []scrobble.Scrobbler
|
||||
Podcasts *podcasts.Podcasts
|
||||
@@ -116,3 +117,14 @@ func (c *Controller) HR(h handlerSubsonicRaw) http.Handler {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *Controller) getMusicFolder(p params.Params) string {
|
||||
idx, err := p.GetInt("musicFolderId")
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
if idx < 0 || idx > len(c.MusicPaths) {
|
||||
return ""
|
||||
}
|
||||
return c.MusicPaths[idx]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user