Make all Subsonic helper functions private

This commit is contained in:
Deluan
2020-08-13 22:11:18 -04:00
committed by Deluan Quintão
parent 22f34b3347
commit c271aa24d1
13 changed files with 150 additions and 150 deletions
+4 -4
View File
@@ -25,7 +25,7 @@ func (c *MediaRetrievalController) GetAvatar(w http.ResponseWriter, r *http.Requ
f, err := resources.AssetFile().Open(consts.PlaceholderAlbumArt)
if err != nil {
log.Error(r, "Image not found", err)
return nil, NewError(responses.ErrorDataNotFound, "Avatar image not found")
return nil, newError(responses.ErrorDataNotFound, "Avatar image not found")
}
defer f.Close()
_, _ = io.Copy(w, f)
@@ -34,7 +34,7 @@ func (c *MediaRetrievalController) GetAvatar(w http.ResponseWriter, r *http.Requ
}
func (c *MediaRetrievalController) GetCoverArt(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error) {
id, err := RequiredParamString(r, "id", "id parameter required")
id, err := requiredParamString(r, "id", "id parameter required")
if err != nil {
return nil, err
}
@@ -46,10 +46,10 @@ func (c *MediaRetrievalController) GetCoverArt(w http.ResponseWriter, r *http.Re
switch {
case err == model.ErrNotFound:
log.Error(r, "Couldn't find coverArt", "id", id, err)
return nil, NewError(responses.ErrorDataNotFound, "Artwork not found")
return nil, newError(responses.ErrorDataNotFound, "Artwork not found")
case err != nil:
log.Error(r, "Error retrieving coverArt", "id", id, err)
return nil, NewError(responses.ErrorGeneric, "Internal Error")
return nil, newError(responses.ErrorGeneric, "Internal Error")
}
return nil, nil