media_gallery icon indicating copy to clipboard operation
media_gallery copied to clipboard

[REQUEST] Create the constructor Media.fromId(id)

Open rignaneseleo opened this issue 4 years ago • 2 comments

Hi, thanks for this library. It works well. I'd like to put media's IDs into my db and show the pictures using queries.

Now the only way is to load the whole list and then get the value with a .where() function.

Can you either give us a Map<int,Media> where the key is the ID or a constructor method called Media.fromId(id) that basically builds the Media from the id?

Thanks

rignaneseleo avatar Jul 05 '20 08:07 rignaneseleo

Yep that would be useful!

Thanks for the suggestion.

aloisdeniel avatar Jul 08 '20 06:07 aloisdeniel

A workaround I found is to create the Media using the .fromJson() function and passing an ID and type to that. It works but it would be better a dedicated method.

rignaneseleo avatar Jul 08 '20 08:07 rignaneseleo