Closed Duberry closed 1 month ago
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?
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...
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.
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...
Whereas I get nothing at all added to the playlist. I'm debugging it...
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.
Got diverted to the search performance issue, looking at this again now.
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 ?
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)?
Or just pass an array of trackIds from BrowseLibrary::_tracks
?
This seems to work: See #1138
I mean PR #1167 !!!
Fixed by #1167 - thanks a ton, @darrell-k!
Thank you. I'll download the Nightly tomorrow and give it a go.
Can report it works. Good job.
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.