Ensemble icon indicating copy to clipboard operation
Ensemble copied to clipboard

Provider discovery

Open relic664 opened this issue 10 months ago • 9 comments

Some providers, like Tidal, have discovery and playlists available through the API. However, it seems Ensemble doesn't surface these the way Music Assistant web and the official Music Assistant Android app do (see below). Is this something that is planned?

Image

relic664 avatar Feb 02 '26 14:02 relic664

It is now 👍🏼

CollotsSpot avatar Feb 02 '26 21:02 CollotsSpot

@CollotsSpot I went ahead and made a PR for this. https://github.com/CollotsSpot/Ensemble/pull/64

relic664 avatar Feb 03 '26 20:02 relic664

Hey @relic664, thanks for putting this PR together! I've been testing the build and digging into the code. Overall the implementation follows the existing patterns well, but I found a few things I wanted to discuss before merging:

The good stuff:

  • MixesRow follows the AlbumRow pattern consistently
  • Caching and provider integration match existing code
  • Localization is complete

Issues I'm seeing:

  1. Visual glitch when switching apps - I'm seeing rendering artifacts (see screenshot). I think this might be from the new Overlay wrapper in main.dart. The PR also added Overlay.maybeOf() checks in HiResBadge and search_screen, which seems like the safer approach. I'm wondering if it's even necessary given the defensive checks are already in place.

  2. MixesRow structure vs home screen architecture - The home screen expects each row entry to render exactly one row with a title. But MixesRow renders multiple shelves with their own titles internally. This feels like it breaks the existing architectural assumption. Was this intentional? The other home rows (AlbumRow, ArtistRow, etc.) are all single horizontal rows.

  3. New RecommendationFolder model and parseMediaItemJson() - This introduces a new polymorphic parsing pattern that isn't used elsewhere in the codebase. Existing models just call their own fromJson() directly. Is this complexity necessary, or could we work with the existing MediaItem parsing?

  4. Hardcoded filtering - The isRecentlyPlayed check uses string matching that could be fragile if MA changes naming:

final isRecentlyPlayed = name == 'recently played' || id.contains('recently_played');

Also: I'm testing on MA 2.8.0b12 with Spotify but getting "No playlist mixes found". Does this feature only work with certain providers? The PR title mentions Tidal specifically.

Let me know your thoughts - happy to test any changes or discuss further. Nice work on this overall!

Image

CollotsSpot avatar Feb 04 '26 05:02 CollotsSpot

Happy to iterate on this and discuss.

  1. I reverted all the main UI changes with the overlay, badges, etc. I had some errors when writing this PR initially and had to make those changes to fix them. Perhaps it was something to do with the debug build specifically, but having rolled back to the original overlay implementation everything still works fine for me, so hopefully that resolves the issue on your end as well.

  2. This was intentional because recommendations are dynamic -- folder names and count can change per provider (or even within the same provider). There isn't a stable row ID to attach to each folder. This also allows us to keep a single toggle for discover playlists in the settings instead of trying to wrangle (potentially) ephemeral toggles.

  3. This goes along with (2) to some extent. The polymorphic parsing is needed because the recommendation payload is heterogeneous. Each folder has mixed media types under a single items array. The existing parser assumes you already know the target type, which doesn't apply here.

  4. This is a reasonable concern, but I'm not sure how to address it in a robust way. This filter exists to de-duplicate "recently played" from the provider with the "recently played" in MA itself. There's no API field that marks a specific recommendation folder as "recently played" so it's hard to target in a more robust way. The only other option I could think of here is to maybe do a bit more robust string matching with different strings: recently played, recently_played, etc). It's scoped to the discover playlists at least, so it limits the blast radius at least, and perhaps could be caught by a unit test.

  5. Re: Spotify - yeah that's expected. Unfortunately Spotify doesn't provide a recommendations endpoint in their API anymore, so it's a limitation on Spotify's end. There's been some indication that they are updating/changing the API, and since it was there previously, maybe it will return in the future.

relic664 avatar Feb 04 '26 12:02 relic664

Thanks for the reply, Could i ask for a screenshot of the new row(s)?

CollotsSpot avatar Feb 04 '26 13:02 CollotsSpot

Sure.

Home: Image

Home (further down showinf discovery mixes):

Image

The build artifact is here if you want to test the apk

https://github.com/relic664/Ensemble/actions/runs/21670597705

relic664 avatar Feb 04 '26 13:02 relic664

I've made some changes so that Each discovery folder from Music Assistant now becomes its own independent Discovery Row on the home screen, following the standard 237px height pattern.

https://github.com/CollotsSpot/Ensemble/actions/runs/21725080008

Can you make sure it looks ok to you?

CollotsSpot avatar Feb 05 '26 19:02 CollotsSpot

Yep everything still looks fine. I'm not too picky about the layout (it's your project after all!) -- just wanted to contribute the functionality more than anything.

Image

relic664 avatar Feb 05 '26 21:02 relic664

Discovery rows are individually toggleable and draggable in settings now. All changes are committed in the code. I am currently waiting for the fdroid merge until i put out another release.

https://github.com/CollotsSpot/Ensemble/actions/runs/21743076802

CollotsSpot avatar Feb 06 '26 08:02 CollotsSpot