mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Make MediaFolder ID int32
This commit is contained in:
parent
1ed6d130b1
commit
0d1e2a92f6
3 changed files with 3 additions and 7 deletions
|
@ -1,8 +1,7 @@
|
|||
package model
|
||||
|
||||
type MediaFolder struct {
|
||||
// TODO Change to int
|
||||
ID string
|
||||
ID int32
|
||||
Name string
|
||||
Path string
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ func (*mediaFolderRepository) GetAll() (model.MediaFolders, error) {
|
|||
}
|
||||
|
||||
func hardCoded() model.MediaFolder {
|
||||
mediaFolder := model.MediaFolder{ID: "0", Path: conf.Server.MusicFolder}
|
||||
mediaFolder := model.MediaFolder{ID: 0, Path: conf.Server.MusicFolder}
|
||||
mediaFolder.Name = "Music Library"
|
||||
return mediaFolder
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package subsonic
|
|||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/deluan/navidrome/conf"
|
||||
|
@ -26,9 +25,7 @@ func (c *BrowsingController) GetMusicFolders(w http.ResponseWriter, r *http.Requ
|
|||
mediaFolderList, _ := c.browser.MediaFolders(r.Context())
|
||||
folders := make([]responses.MusicFolder, len(mediaFolderList))
|
||||
for i, f := range mediaFolderList {
|
||||
// TODO Change model.MediaFolder.ID to int
|
||||
id, _ := strconv.ParseInt(f.ID, 10, 32)
|
||||
folders[i].Id = int32(id)
|
||||
folders[i].Id = f.ID
|
||||
folders[i].Name = f.Name
|
||||
}
|
||||
response := NewResponse()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue