mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Change MediaFolder.ID type to int32
This commit is contained in:
parent
d24709b521
commit
1cfa7b2272
4 changed files with 9 additions and 9 deletions
|
@ -9,6 +9,6 @@ type MediaFolder struct {
|
|||
type MediaFolders []MediaFolder
|
||||
|
||||
type MediaFolderRepository interface {
|
||||
Get(id string) (*MediaFolder, error)
|
||||
Get(id int32) (*MediaFolder, error)
|
||||
GetAll() (MediaFolders, error)
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ func NewMediaFolderRepository(ctx context.Context, o orm.Ormer) model.MediaFolde
|
|||
return &mediaFolderRepository{ctx}
|
||||
}
|
||||
|
||||
func (r *mediaFolderRepository) Get(id string) (*model.MediaFolder, error) {
|
||||
func (r *mediaFolderRepository) Get(id int32) (*model.MediaFolder, error) {
|
||||
mediaFolder := hardCoded()
|
||||
return &mediaFolder, nil
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ type StatusInfo struct {
|
|||
MediaFolder string
|
||||
Scanning bool
|
||||
LastScan time.Time
|
||||
Count int
|
||||
Count int64
|
||||
}
|
||||
|
||||
type FolderScanner interface {
|
||||
|
@ -42,7 +42,7 @@ type scanner struct {
|
|||
|
||||
type scanStatus struct {
|
||||
active bool
|
||||
count int
|
||||
count int64
|
||||
lastUpdate time.Time
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ func (s *scanner) getStatus(folder string) *scanStatus {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *scanner) setStatus(folder string, active bool, count int, lastUpdate time.Time) {
|
||||
func (s *scanner) setStatus(folder string, active bool, count int64, lastUpdate time.Time) {
|
||||
s.lock.Lock()
|
||||
defer s.lock.Unlock()
|
||||
if status, ok := s.status[folder]; ok {
|
||||
|
|
|
@ -37,8 +37,8 @@ func (c *BrowsingController) GetMusicFolders(w http.ResponseWriter, r *http.Requ
|
|||
return response, nil
|
||||
}
|
||||
|
||||
func (c *BrowsingController) getArtistIndex(ctx context.Context, mediaFolderId string, ifModifiedSince time.Time) (*responses.Indexes, error) {
|
||||
folder, err := c.ds.MediaFolder(ctx).Get(mediaFolderId)
|
||||
func (c *BrowsingController) getArtistIndex(ctx context.Context, mediaFolderId int, ifModifiedSince time.Time) (*responses.Indexes, error) {
|
||||
folder, err := c.ds.MediaFolder(ctx).Get(int32(mediaFolderId))
|
||||
if err != nil {
|
||||
log.Error(ctx, "Error retrieving MediaFolder", "id", mediaFolderId, err)
|
||||
return nil, newError(responses.ErrorGeneric, "Internal Error")
|
||||
|
@ -80,7 +80,7 @@ func (c *BrowsingController) getArtistIndex(ctx context.Context, mediaFolderId s
|
|||
}
|
||||
|
||||
func (c *BrowsingController) GetIndexes(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error) {
|
||||
musicFolderId := utils.ParamString(r, "musicFolderId")
|
||||
musicFolderId := utils.ParamInt(r, "musicFolderId", 0)
|
||||
ifModifiedSince := utils.ParamTime(r, "ifModifiedSince", time.Time{})
|
||||
|
||||
res, err := c.getArtistIndex(r.Context(), musicFolderId, ifModifiedSince)
|
||||
|
@ -94,7 +94,7 @@ func (c *BrowsingController) GetIndexes(w http.ResponseWriter, r *http.Request)
|
|||
}
|
||||
|
||||
func (c *BrowsingController) GetArtists(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error) {
|
||||
musicFolderId := utils.ParamString(r, "musicFolderId")
|
||||
musicFolderId := utils.ParamInt(r, "musicFolderId", 0)
|
||||
res, err := c.getArtistIndex(r.Context(), musicFolderId, time.Time{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue