Skip to content

Commit

Permalink
feat: support filter by genre in browse by folder mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sentriz committed Aug 23, 2021
1 parent 6e2d4f7 commit b56f00e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/ctrlsubsonic/handlers_by_folder.go
Expand Up @@ -112,6 +112,10 @@ func (c *Controller) ServeGetAlbumList(r *http.Request) *spec.Response {
params.GetOrInt("toYear", 2200),
params.GetOrInt("fromYear", 1800))
q = q.Order("tag_year")
case "byGenre":
genre, _ := params.Get("genre")
q = q.Joins("JOIN album_genres ON album_genres.album_id=albums.id")
q = q.Joins("JOIN genres ON genres.id=album_genres.genre_id AND genres.name=?", genre)
case "frequent":
user := r.Context().Value(CtxUser).(*db.User)
q = q.Joins(`
Expand Down

0 comments on commit b56f00e

Please sign in to comment.