From b3c863c386adb830cdb45f45644f4779a4b73e86 Mon Sep 17 00:00:00 2001 From: sentriz Date: Tue, 26 Sep 2023 12:03:15 +0100 Subject: [PATCH] feat(subsonic): order results from getStarred reverse chronologically based on star date --- server/ctrlsubsonic/handlers_by_tags.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/ctrlsubsonic/handlers_by_tags.go b/server/ctrlsubsonic/handlers_by_tags.go index 4ffb7e6..2b73bc6 100644 --- a/server/ctrlsubsonic/handlers_by_tags.go +++ b/server/ctrlsubsonic/handlers_by_tags.go @@ -450,6 +450,7 @@ func (c *Controller) ServeGetStarredTwo(r *http.Request) *spec.Response { Where("artist_stars.user_id=?", user.ID). Joins("JOIN album_artists ON album_artists.artist_id=artists.id"). Joins("JOIN albums ON albums.id=album_artists.album_id"). + Order("artist_stars.star_date DESC"). Preload("ArtistStar", "user_id=?", user.ID). Preload("ArtistRating", "user_id=?", user.ID). Preload("Info"). @@ -469,6 +470,7 @@ func (c *Controller) ServeGetStarredTwo(r *http.Request) *spec.Response { q = c.DB. Joins("JOIN album_stars ON album_stars.album_id=albums.id"). Where("album_stars.user_id=?", user.ID). + Order("album_stars.star_date DESC"). Preload("Artists"). Preload("AlbumStar", "user_id=?", user.ID). Preload("AlbumRating", "user_id=?", user.ID) @@ -487,6 +489,7 @@ func (c *Controller) ServeGetStarredTwo(r *http.Request) *spec.Response { q = c.DB. Joins("JOIN track_stars ON tracks.id=track_stars.track_id"). Where("track_stars.user_id=?", user.ID). + Order("track_stars.star_date DESC"). Preload("Album"). Preload("TrackStar", "user_id=?", user.ID). Preload("TrackRating", "user_id=?", user.ID)