mmatyas / pegasus-frontend

A cross platform, customizable graphical frontend for launching emulators and managing your game collection.
http://pegasus-frontend.org
Other
1.17k stars 104 forks source link

Media Provider: Un-mark as internal so it can be optionally disabled #1090

Closed nicjansma closed 7 months ago

nicjansma commented 8 months ago

Alongside some Android startup improvements in https://github.com/mmatyas/pegasus-frontend/pull/1089, I found that the Media processing was taking a long time during Pegasus startup.

For example, on an Anbernic RG405M device with 40k+ screenshots, it's taking over 32s:

2023-11-08T15:49:55 [i] Media: Finished searching in 32105ms

Guided by a comment in https://github.com/mmatyas/pegasus-frontend/issues/839#issuecomment-1087747818, I tried disabling the Media provider, and it cut out this delay entirely.

After I did this, I reviewed my theme and could not find any side-effects -- all screenshots were continuing to load OK. I reviewed its code, and could not find other obvious places its output would be used, so I must be missing something. Is there something the MediaProvider is doing that I'm breaking by disabling it?

Anyways, for my use-case, it seems like avoiding the MediaProvider is beneficial (faster startup) and causes no side-effects.

This PR un-marks the MediaProvider as internal, so that users can optionally disable it in via just the UI, instead of building a custom APK.

image

mmatyas commented 7 months ago

The Media provider looks for assets for your games, but based on the other issue, and that none of the provider are turned on on your screenshot, I assume all your games already have those set manually. It does sound reasonable to disable the Media provider in that case. Thank you for your contribution!

mmatyas commented 7 months ago

I was planning to update the provider name, but got a bit delayed... I'll just merge this first.