uamp icon indicating copy to clipboard operation
uamp copied to clipboard

Question: What should be changed and where, to make it actually handle files from the device

Open AndroidDeveloperLB opened this issue 6 years ago • 3 comments

Music files, including album art and all...

AndroidDeveloperLB avatar Dec 16 '19 21:12 AndroidDeveloperLB

At first glance, I'm not sure how difficult it might be. It seems one would have to create a prompt to get READ_EXTERNAL_STORAGE permission, and then build your own MusicSource to interface with MediaStore.

Album art would be more tricky, and would depend if the files included them inside the metadata, or if it would need to use a web service to locate and download the artwork.

You could also consider updating BrowseTree to present different or additional filters.

I suspect one of the bigger issues that you may run into is sending back what may be quite a few MediaItems in MediaItemFragmentViewModel.subscriptionCallback. UAMP only ever sends back a dozen or so items, but I know some people have thousands of music items.

The solution would be to use the paging library and fetching a subset of the media items, but that makes the UI even more complicated. :)

nic0lette avatar Dec 19 '19 12:12 nic0lette

Can you please update the repository, or at least put a link to a sample/tutorial of how it's done?

AndroidDeveloperLB avatar Dec 20 '19 10:12 AndroidDeveloperLB

I'd also love to see some samples of loading local data. The remote fetching is kinda advanced topic compared to local playback, which also changed a lot with the recent platform and privacy updates.

I haven't found any good guides on how to properly load local media. Most code I've seen is old and would probably fail because either platform privacy changes or it's not meant to be used with the entire MediaBrowser concept.

At the moment I feel a crucial and basic tutorial on local playback is missing, as everything I've read is really abstract and general and it's hard to really know if anything we come up with is actually the right way to do it.

ghost avatar Mar 18 '20 15:03 ghost