use track artists and album artists more appropriately

for example using track artists to find top songs, and returning artist
features in artist album lists
This commit is contained in:
sentriz
2023-11-07 22:49:43 +00:00
parent 98eb1066d8
commit 0f611d7f7a
3 changed files with 19 additions and 13 deletions

View File

@@ -232,11 +232,13 @@ func (c *Controller) ServeSearchTwo(r *http.Request) *spec.Response {
// search "albums"
var albums []*db.Album
q = c.dbc.Joins("JOIN album_artists ON album_artists.album_id=albums.id")
q = c.dbc.
Joins("JOIN album_artists ON album_artists.album_id=albums.id")
for _, s := range queries {
q = q.Where(`right_path LIKE ? OR right_path_u_dec LIKE ?`, s, s)
}
q = q.Preload("AlbumStar", "user_id=?", user.ID).
q = q.
Preload("AlbumStar", "user_id=?", user.ID).
Preload("AlbumRating", "user_id=?", user.ID).
Offset(params.GetOrInt("albumOffset", 0)).
Limit(params.GetOrInt("albumCount", 20))