Skip to content

🎧 Your Personal Streaming Service

Add support for artist 5-star rating in Subsonic API

Deluan156a53c2ac66
diff --git a/server/subsonic/media_annotation.go b/server/subsonic/media_annotation.go
index 370a05d18..e59daec5a 100644
--- a/server/subsonic/media_annotation.go
+++ b/server/subsonic/media_annotation.go
@@ -49,13 +49,21 @@ func (c *MediaAnnotationController) SetRating(w http.ResponseWriter, r *http.Req
}
func (c *MediaAnnotationController) setRating(ctx context.Context, id string, rating int) error {
- exist, err := c.ds.Album(ctx).Exists(id)
- if err != nil {
+ var exist bool
+ var err error
+
+ if exist, err = c.ds.Artist(ctx).Exists(id); err != nil {
return err
+ } else if exist {
+ return c.ds.Artist(ctx).SetRating(rating, id)
}
- if exist {
+
+ if exist, err = c.ds.Album(ctx).Exists(id); err != nil {
+ return err
+ } else if exist {
return c.ds.Album(ctx).SetRating(rating, id)
}
+
return c.ds.MediaFile(ctx).SetRating(rating, id)
}