fix(subsonic): getLyrics does not try to retrieve lyrics from external files (#4232)
This commit is contained in:
@@ -108,14 +108,13 @@ func SongsByRandom(genre string, fromYear, toYear int) Options {
|
|||||||
return addDefaultFilters(options)
|
return addDefaultFilters(options)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SongWithLyrics(artist, title string) Options {
|
func SongWithArtistTitle(artist, title string) Options {
|
||||||
return addDefaultFilters(Options{
|
return addDefaultFilters(Options{
|
||||||
Sort: "updated_at",
|
Sort: "updated_at",
|
||||||
Order: "desc",
|
Order: "desc",
|
||||||
Max: 1,
|
Max: 1,
|
||||||
Filters: And{
|
Filters: And{
|
||||||
Eq{"title": title},
|
Eq{"title": title},
|
||||||
NotEq{"lyrics": "[]"},
|
|
||||||
Or{
|
Or{
|
||||||
persistence.Exists("json_tree(participants, '$.albumartist')", Eq{"value": artist}),
|
persistence.Exists("json_tree(participants, '$.albumartist')", Eq{"value": artist}),
|
||||||
persistence.Exists("json_tree(participants, '$.artist')", Eq{"value": artist}),
|
persistence.Exists("json_tree(participants, '$.artist')", Eq{"value": artist}),
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ func (api *Router) GetLyrics(r *http.Request) (*responses.Subsonic, error) {
|
|||||||
response := newResponse()
|
response := newResponse()
|
||||||
lyricsResponse := responses.Lyrics{}
|
lyricsResponse := responses.Lyrics{}
|
||||||
response.Lyrics = &lyricsResponse
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user