fix(subsonic): getLyrics does not try to retrieve lyrics from external files (#4232)

This commit is contained in:
wilywyrm 2025-06-15 09:40:40 -07:00 committed by Joe Stump
parent 4ced7de3b7
commit f6129cc450
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9
2 changed files with 2 additions and 3 deletions

View File

@ -108,14 +108,13 @@ func SongsByRandom(genre string, fromYear, toYear int) Options {
return addDefaultFilters(options)
}
func SongWithLyrics(artist, title string) Options {
func SongWithArtistTitle(artist, title string) Options {
return addDefaultFilters(Options{
Sort: "updated_at",
Order: "desc",
Max: 1,
Filters: And{
Eq{"title": title},
NotEq{"lyrics": "[]"},
Or{
persistence.Exists("json_tree(participants, '$.albumartist')", Eq{"value": artist}),
persistence.Exists("json_tree(participants, '$.artist')", Eq{"value": artist}),

View File

@ -98,7 +98,7 @@ func (api *Router) GetLyrics(r *http.Request) (*responses.Subsonic, error) {
response := newResponse()
lyricsResponse := responses.Lyrics{}
response.Lyrics = &lyricsResponse
mediaFiles, err := api.ds.MediaFile(r.Context()).GetAll(filter.SongWithLyrics(artist, title))
mediaFiles, err := api.ds.MediaFile(r.Context()).GetAll(filter.SongWithArtistTitle(artist, title))
if err != nil {
return nil, err