mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 21:17:37 +03:00
Repositories must return error value
This commit is contained in:
parent
784a8c1413
commit
33c6535da9
2 changed files with 3 additions and 3 deletions
|
@ -13,7 +13,7 @@ func (this *GetMusicFoldersController) Get() {
|
|||
validate(this)
|
||||
|
||||
repository := new(repositories.MediaFolderRepository)
|
||||
mediaFolderList := repository.GetAll()
|
||||
mediaFolderList, _ := repository.GetAll()
|
||||
folders := make([]responses.MusicFolder, len(mediaFolderList))
|
||||
for i, f := range mediaFolderList {
|
||||
folders[i].Id = f.Id
|
||||
|
|
|
@ -7,9 +7,9 @@ import (
|
|||
|
||||
type MediaFolderRepository struct {}
|
||||
|
||||
func (*MediaFolderRepository) GetAll() []*models.MediaFolder {
|
||||
func (*MediaFolderRepository) GetAll() ([]*models.MediaFolder, error) {
|
||||
mediaFolder := models.MediaFolder{Id: "1", Name: "iTunes Library", Path: beego.AppConfig.String("musicFolder")}
|
||||
result := make([]*models.MediaFolder, 1)
|
||||
result[0] = &mediaFolder
|
||||
return result
|
||||
return result, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue