music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.21k stars 43 forks source link

Search results are duplicated when typed fast #2145

Closed FreyrPL closed 2 months ago

FreyrPL commented 2 months ago

What version of Music Assistant has the issue?

2.0.0b139

What version of the Home Assistant Integration have you got installed?

2024.4.0

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

The problem

Search engine doesn't find all the results it should. Problem occured during past 3 weeks after one of recent updates. Already tried reinstalling. No luck. Example.on screenshot. Missing result also has wrong icon but it's same file type as others and it is playable as track.

Screenshot_2024-04-21-10-28-08-551_io homeassistant companion android Screenshot_2024-04-21-10-27-21-878_io homeassistant companion android

How to reproduce

Use search function

Music Providers

Filesystem -remote share

Player Providers

DLNA/Airoplay (onkyo)

Full log output

No response

Additional information

No response

What version of Home Assistant Core are your running

2024.4.3

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Alternative

OzGav commented 2 months ago

It’s not clear from the images what the problem is. In the first image I see you are browsing and there are two files and one folder and it isn’t clear what is in that folder. Then in the second image there are two tracks? It is unlikely it is the search failing. Just look through the library and see if they are even in there.

edit: it would be very unusual if a file was being shown as a folder. Show a screen capture of the folder from your OS of choice

FreyrPL commented 2 months ago

As i mentioned before-the icon is wrong. There are 3 files. No folders. This file with folder icon is not shown in search results but it can be played. This is just example. Problem applies to many files.

Screenshot fron android phone: Screenshot_2024-04-21-12-09-25-096_com mi android globalFileexplorer-edit

EDIT: PC screenshots(last one RMB clicked on "folder" file: 1 2 3

OzGav commented 2 months ago

I know Marcel has said before the browse function has limitations. The real question is why the file isn’t in the library. The log should reveal why but typically the reason is tagging problems

FreyrPL commented 2 months ago

It worked perfectly fine until last 2-3 weeks. Unfortunately i don' know which update broke browsing and i i don't have 'working' backup. I'll add logs aflter i solving 401 error while downloading.

OzGav commented 2 months ago

You should not be worried about browsing. That is like a fallback option. The question is why the third track hasn’t been loaded into the library.

Edit: so it looks like only two tracks have been loaded into the library under Aronchupa. How has that missing track been tagged?

edit: also look for Trombone in the track view, what do you see there?

FreyrPL commented 2 months ago

Im not worried :) Browsing works, but i need to remember exactly where is everything, because track search doesn't.

I'll check tagging ( done long ago with Picard) when i get access to PC

Track searching "Trombone":

Screenshot_2024-04-21-14-24-23-785_io homeassistant companion android

After deleting 'e' from search above: Screenshot_2024-04-21-14-25-01-737_io homeassistant companion android

Edit: I have only one instance of each file, but search finds multiple.

OzGav commented 2 months ago

So it looks like all of the tracks have been loaded into the library but there is some sort of linking problem as even though both Trombone tracks are there only one is linked to Aronchupa. Why you are seeing multiple when the full word is typed is also unusual. I assume you only see those two tracks until you type that last e?

FreyrPL commented 2 months ago

It's more complicated ;) If i type slow, then there are just 2 results (ok) If i type fast, then there are multiple...and if i scroll down, there is every track from library:

Screenshot_2024-04-21-16-35-09-103_io homeassistant companion android

, but if i go back and forth (search already typed in), there are just two results. Weird...

OzGav commented 2 months ago

Yeah sounds like a frontend bug although I don’t see it. Does it happen only on your phone?

FreyrPL commented 2 months ago

Same on chrome (win11 pc). One more observation on pc. When i type slowly: "Trom" - 2 results "Tromb" - 2 results "Trombo" - no results "Trombon" - 2 results "Trombone" - 2 results Same everytime. With "o" at the end -no results

Fast/slow typing is related with animated progress bar. If it finishes searching before next character is typed - no multiplication in results.

OzGav commented 2 months ago

Ok we will try and reproduce this or will come back and ask for more info.

OzGav commented 2 months ago

OK I see the issue when typing quickly. Would it be fair to say the title of this should be changed to "Search results are duplicated when typed fast"?

edit: Also we are looking at a separate frontend bug as well. Can you try typing a single A in the GLOBAL search field and see what happens

FreyrPL commented 2 months ago

No problem. And with update b140 missing results are gone. To be fair, i did run picard again on all the music i have and it did a lot of changes to tags, but files missed in results were not touched. They appear correctly in Track Search. Multiplication still there.

@ edit Nothing happens after A. Typing second character gives results. (Update b140)

OzGav commented 2 months ago

OK so I will change the title as the issue of duplicated results when typing fast I can reproduce.

Interesting that nothing happens for you when you type an A. I experience a loop refresh problem then. But if I type a B then I do get results so not sure why you don't see any with A.... Confirming we are talking about in this search box image

FreyrPL commented 2 months ago

Same search. Global. I wasn't patient enough. At first, nothing happens. Then i get results. Then everything disappears. Like on screenshot. Screenshot_2024-04-23-07-32-48-179_io homeassistant companion android

OzGav commented 2 months ago

Interesting. We are digressing from your original problem but is the screen constantly refreshing or is it just sitting there blank? And it looks like you can’t type anything else now? Maybe check the logs to see if there is an error

Edit: Can you try typing a B and see if anything different happens...

FreyrPL commented 2 months ago

As i mentioned before, on update b140 i can't reproduce missing results, so the true, original problem seems gone.

Screen is blank. No, i can't type anything.

In the meantime mass updated to b141 and the problem with global search is gone. Multiplication is also gone, but there is still all the library below results Screenshot_2024-04-23-08-08-55-680_io homeassistant companion android Screenshot_2024-04-23-08-06-32-147_io homeassistant companion android

OzGav commented 2 months ago

Because of the frontend bug with typing in the search field, type in Aron then remove the n and then add it again (or type slowly). See if you only get results for that now?

FreyrPL commented 2 months ago

Upd b141

After removing n, and retyping it, i only get results for that, what i was searching for.

OzGav commented 2 months ago

OK would you agree that there are no problems with the search function rather it is a frontend bug with the speed that the text is typed?

FreyrPL commented 2 months ago

There were problems, but i agree that now those are gone.

marcelveldt commented 2 months ago

this one can be closed ? all good now ?

FreyrPL commented 2 months ago

On ver. 0b142 seems ok, so can be closed.

OzGav commented 2 months ago

Unfortunately I am still seeing this image

image

But I would bring your attention to the thumbnail. For some reason it isn't showing the correct 2 letters. When the duplication occurs it is showing letters from another band on the same (various artists) album.

OzGav commented 2 months ago

In beta 144 this seems ok!