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.36k stars 52 forks source link

Radio stations on homescreen - maybe a question, not an error #1756

Closed melwinek closed 8 months ago

melwinek commented 10 months ago

What version of Music Assistant has the issue?

2.0.0b80

The problem

The home screen shows radio stations that no longer exist. image image

How to reproduce

Add a radio station and then delete it.

Relevant log output

No response

Additional information

No response

What version of Home Assistant Core are your running

2023.12.4

What type of installation are you running?

Home Assistant Core

On what type of hardware are you running?

Generic x86-64 (e.g. Intel NUC)

OzGav commented 10 months ago

They are pulled from your favourites, I'm guessing TuneIn?

Edit: OK I see you are saying the Home Screen. I will have to look at that some more

OzGav commented 10 months ago

How are you adding and deleting these stations?

melwinek commented 10 months ago

From Radio browser Screenshot_20240103-162737_Pixel Launcher~2

OzGav commented 9 months ago

I was unable to reproduce this. The station disappeared from the Home Screen as soon as I removed it from the library. Just to confirm I removed from the library by going to the radio view and selecting the menu for the station.

Can you try adding those stations back into your library and then once the Home Screen and the radio screen look the same then try removing one and see if it is removed correctly.

melwinek commented 9 months ago

It doesn't remove itself from the home screen.

Log: 2024-01-06 10:03:12.319 ERROR (MainThread) [music_assistant.webserver] [140450274436368] Error handling message: CommandMessage(message_id=22, command='music/favorites/remove_item', args={'media_type': 'radio', 'library_item_id': '38996cf5-f44c-470e-b7d7-59ea9fa8c298'}) Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/webserver.py", line 372, in _run_handler result = await result ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/music.py", line 373, in remove_item_from_favorites await ctrl.set_favorite( File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 412, in set_favorite db_id = int(item_id) # ensure integer ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '38996cf5-f44c-470e-b7d7-59ea9fa8c298' 2024-01-06 10:04:16.941 INFO (MainThread) [music_assistant.providers.radiobrowser] Provider RadioBrowser does not support library edit, the action will only be performed in the local database.

OzGav commented 9 months ago

Your screenshot above shows me how you are adding the station to the library. Please show a screenshot of how you are removing the station

melwinek commented 9 months ago

In the same way. Using "remove from library". At this point I dealt with it the brute force way, I opened library.db in HeidiSQL and cleaned up the tables.

OzGav commented 9 months ago

Yeah OK I don't think you can remove it from the browse view...I can't. I remove it via the RADIO view

OzGav commented 9 months ago

Unless of course all this happened during the recent DB upgrade and something got messed up

melwinek commented 9 months ago

I'm not entirely sure yet. But I think I know what the problem is. I had RadioBrowser added in MA and in HA integrations. When I removed it from HA, the problems seemed to go away.

OzGav commented 9 months ago

Weird as there is no link that way that I know of but if this is resolved we might close it?

melwinek commented 9 months ago

However, the above was not a problem. But I think I found a mistake. If table "playlog" is empty. Radio stations on homescreen are correct. image Then if I turn on each station one by one and the "playlog" table will be filled with entries. image The stations on the homescreen are duplicated. image

After clearing the "playlog" table again, everything is fine again. And it stays like this all the time.

This is my station list: image

marcelveldt commented 9 months ago

The homescreen shows a list a list of items based on what was recently played AND what's in the library. But I agree that is a bit strange, we should limit to library items only and filter on what has recently been played.

marcelveldt commented 8 months ago

This one is fixed in b103