Skip to content

Commit

Permalink
feat(subsonic): support getAlbumList/getAlbumList2 type=highest
Browse files Browse the repository at this point in the history
closes #404
  • Loading branch information
sentriz committed Nov 8, 2023
1 parent 2df9052 commit a30ee3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/ctrlsubsonic/handlers_by_folder.go
Expand Up @@ -160,6 +160,9 @@ func (c *Controller) ServeGetAlbumList(r *http.Request) *spec.Response {
case "starred":
q = q.Joins("JOIN album_stars ON albums.id=album_stars.album_id AND album_stars.user_id=?", user.ID)
q = q.Order("right_path")
case "highest":
q = q.Joins("JOIN album_ratings ON album_ratings.album_id=albums.id AND album_ratings.user_id=?", user.ID)
q = q.Order("album_ratings.rating DESC")
default:
return spec.NewError(10, "unknown value %q for parameter 'type'", v)
}
Expand Down
3 changes: 3 additions & 0 deletions server/ctrlsubsonic/handlers_by_tags.go
Expand Up @@ -175,6 +175,9 @@ func (c *Controller) ServeGetAlbumListTwo(r *http.Request) *spec.Response {
case "starred":
q = q.Joins("JOIN album_stars ON albums.id=album_stars.album_id AND album_stars.user_id=?", user.ID)
q = q.Order("tag_title")
case "highest":
q = q.Joins("JOIN album_ratings ON album_ratings.album_id=albums.id AND album_ratings.user_id=?", user.ID)
q = q.Order("album_ratings.rating DESC")
default:
return spec.NewError(10, "unknown value %q for parameter 'type'", listType)
}
Expand Down

0 comments on commit a30ee3d

Please sign in to comment.