jaedb / Iris

Discover, explore and manage your music library across multiple sources with this beautiful web-based interface. Iris is a Mopidy frontend extension.
Apache License 2.0
1.13k stars 130 forks source link

Dynamic `manifest.json` with custom `short_name` #795

Open maystar opened 2 years ago

maystar commented 2 years ago

Problem to solve

Hey! I really like to use mopidy with the iris extension. Especially because it can be used very smooth on smartphones when using Chrome on Android and install the progressive web app. I've several raspberry pis at home running mopidy. Unfortunately I can't distinguish between the installed PWAs on my device, because all have the same name and icon.

Proposed solution

Provide configuration properties to specify short_name and name of the pwa manifest.

Additional info

No response

jaedb commented 2 years ago

This will require some research, but because manifest.json is part of the application bundle its ability to be modified realtime is somewhat limited. I think the approach would be to put it through a Tornado (the webserver) template.

The difficulty with modifying the manifest file is that changes can be difficult to propagate. Force clearing the cache as well as uninstalling the service worker seem necessary to achieve this.

maystar commented 2 years ago

Thanks for your reply! I think the issue with the cache can be handled with documentation. It might be possible to change an updatable field, too.

I've no experience with your solution and python web frameworks at all. But I see, that manifest.json is catch in its own request. So my strategy would be to create an explicit end point for /iris/manifest.json which reads the base manifest from the bundle, make some string-search-and-replace before providing it to the client. Do you think, that this is possible?