home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.84k stars 30.09k forks source link

Squeezebox Browser Lists truncated #126012

Open annomatik opened 2 weeks ago

annomatik commented 2 weeks ago

The problem

Hi! Not sure, to which extent. But the lists in the media player are heavily truncated for my Squeezebox integration.

According to MusicBee, I currently have 48.378 tracks in my collection (which I'm also using for Squeezebox / LMS). In MusicBee, one of the last entries is "Zyon":

image

In the Artist browser of the Home Assistant Media Player with Squeezebox integration, the last entry is Angela Carrasco. Yes, it seems to be sorted alphabetically:

image

For Albums, MusicBee tells me the last one is ZZYZX:

image

In the Album browser of the Home Assistant Media Player with Squeezebox integration, the last entry is "Ending of Time":

image

Tracks are unsorted in the Home Assistant Media Player with Squeezebox integration, but I don't have the impression it's all of them.

Playlists seem to be complete, but I don't have that many of them.

Genres also seem to be complete.

What version of Home Assistant Core has the issue?

core-2024.9.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Squeezebox

Link to integration documentation on our website

https://www.home-assistant.io/integrations/squeezebox/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 2 weeks ago

Hey there @rajlaud, mind taking a look at this issue as it has been labeled with an integration (squeezebox) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `squeezebox` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign squeezebox` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


squeezebox documentation squeezebox source (message by IssueLinks)

peteS-UK commented 1 week ago

Browse limit is currently 1,000 I think. https://github.com/home-assistant/core/blob/dev/homeassistant/components/squeezebox/browse_media.py#L73 The problem I think is that the media browser in HA doesn't understand paging - I think you have to read the whole object into the media browser - so to read all of the tracks, you'd be querying the whole track list in one go. There's probably a feature request to make the browse limit configurable perhaps. Ideally, the media browser would have a search function, but that's not there currently.

rajlaud commented 1 week ago

Yes, I think this is the best we can do until there are improvements to the media browser to accommodate large responses.

When I was originally developing the media browser code for squeezebox, I did not set a browse limit. I also have a large library and found it bogged down the frontend unmanageably.

I'm open to the idea of making the response limit configurable, but it feels a bit like a hack. Really it should be set programmatically to match the number of results the frontend needs to fill a page (if/when paging is added).

peteS-UK commented 1 week ago

Yep - the media browser is pretty basic atm - no paging and no search are really key. We could just add an Options flow to the config flow so that people can configure it and then make the choice of performance vs. size of list for themselves. Once all the current changes have settled down, I can do a PR if you like - Options flow is quite straight forwards but I can do it if you haven't done one before. I've no idea how to do the translations strings for the form though.

annomatik commented 1 week ago

Would it be very ambituous to add paging to the media browser? That would help for other media player integrations as well, right?

peteS-UK commented 1 week ago

Would it be very ambituous to add paging to the media browser? That would help for other media player integrations as well, right?

That's the right solution, but the media browser is a core component of HA as you say, so it's a feature request for HA that would be required. If the browser supported paging and searching it would be much more functional.

annomatik commented 3 days ago

Request for Paging posted here: https://github.com/home-assistant/frontend/discussions/22128