Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all songs from search not working #1138

Closed
Duberry opened this issue Jul 23, 2024 · 15 comments
Closed

Add all songs from search not working #1138

Duberry opened this issue Jul 23, 2024 · 15 comments
Labels

Comments

@Duberry
Copy link

Duberry commented Jul 23, 2024

When selecting on the 'add' or 'play' links at the top of a search result, only the first track returned is added to the currently selected devices playlist.

image

image

@michaelherger
Copy link
Member

michaelherger commented Aug 4, 2024

Hmm... I'm seeing a different behaviour: LMS would add all my library... How exactly did you get to this screen? What LMS version is this?

@darrell-k
Copy link
Contributor

I did some work in this area, at least for LMS 9.0. So depending of the version @Duberry is running, I've either fixed it or broken it...

@Duberry
Copy link
Author

Duberry commented Sep 4, 2024

Updated to 9.0.0 development build.

The behaviour persists. When I search within the 'Songs' search option, selecting the 'play' icon on the 'All Songs' top line results in only the first search return being added to the active players playlist.

I apologise for being unable to assist with much in the way of debugging. I'm an experienced LAMP / JavaScript developer and used to write a lot of Perl code decades ago, but the Lyrion codebase and trying to figure out how it all fits together makes my brain hurt.

Update from 8.5.3 to 9.0.0 was glitch free on Linux migration from Ubuntu repository logitechmediaserver package to installation of the .deb using dpkg. Removed logitechmediaserver first then installed lyrion 9.0.0. Database and plug-ins all persisted.

@michaelherger
Copy link
Member

I can only confirm so far that it's broken for me too. But I'd actually get the first two items - in reversed order...

@darrell-k
Copy link
Contributor

Whereas I get nothing at all added to the playlist. I'm debugging it...

@Duberry
Copy link
Author

Duberry commented Sep 10, 2024

I'm keeping an eye on the nightlies and I can see changes being made to the search source. Updated and still the same behaviour, let me know if you need any testing.

@darrell-k
Copy link
Contributor

Got diverted to the search performance issue, looking at this again now.

@darrell-k
Copy link
Contributor

OK, I know what's going on here. A search for songs will use the fulltextsearch, so for example a search for "Elvis Costello" returns me a list of all songs featuring Elvis Costello.

However, clicking "All Songs" play or add simply does a search for track names containing "Elvis Costello", so in this case comes up with nothing and so adds nothing to the play queue.

This explains the inconsistent behaviour we're seeing: depending on the original search terms, anything between zero and all the songs will be added. So it will work as expected when searching for a song name, but not when searching eg songs for an artist.

I think the culprit is the code at the top of _getTagDataForTracks: because it receives the $search parameter as something like sql=(tracks.titlesearch LIKE 'ELVIS%' OR tracks.titlesearch LIKE '% ELVIS%') it just feeds that into the query and skips the fulltext search.

We could fix it there, or go back to BrowseLibrary::_tracks and make sure it's passing only the search terms and not an SQL snippet.

What do you think would be the best approach, @michaelherger ?

@michaelherger
Copy link
Member

Could the search expression passed to the page handler be tweaked to transfer some cache key, in which the result set could be cached (or rather only the IDs of the resultset)?

@darrell-k
Copy link
Contributor

Or just pass an array of trackIds from BrowseLibrary::_tracks?

darrell-k added a commit to darrell-k/slimserver that referenced this issue Sep 16, 2024
@darrell-k
Copy link
Contributor

This seems to work: See #1138

@darrell-k
Copy link
Contributor

I mean PR #1167 !!!

@michaelherger
Copy link
Member

Fixed by #1167 - thanks a ton, @darrell-k!

@Duberry
Copy link
Author

Duberry commented Sep 17, 2024

Thank you. I'll download the Nightly tomorrow and give it a go.

@Duberry
Copy link
Author

Duberry commented Sep 17, 2024

Can report it works. Good job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants