calaldees / KaraKara

Karaoke Event System - Attendees can view and queue tracks from their mobile phones
https://karakara.uk
GNU General Public License v3.0
28 stars 9 forks source link

`track_list.json` from static file #86

Closed calaldees closed 2 years ago

calaldees commented 2 years ago

/queue/NAME/track_list.json is now a static file. This is shared between nginx and website containers in a volume mounted in /static/ in both containers. The generation of these files is made with a call to PATCH /track_import. This is not web-visible and can be triggered manually if needed with make docker_exec_website_generate_static_track_list. See Makefile for details. This has been added to the last step of processmedia2 so in theory should always be up to date with the latest track lists. WARNING: Changing the tags.hidden settings will require a manual regeneration of the track_list.json.

No track_list.json is a static file it has a content length and we can implement a progress bar for first load.

Ideally I would like it if the track_list.json static file is not present, it would automatically fall back and pass-through to the actual normal endpoint, but I could not get this to work. @shish can you advise on this? See try-files in nginx.conf for my attempt. https://github.com/calaldees/KaraKara/compare/track_static_file?expand=1#diff-4adaaefa7fc959e7dfe65e8dc8dadc9ee27ddd284eee3426463b1cdc000587d5R78

try-files passthrough, a user needs to manually run make docker_exec_website_generate_static_track_list once the stack has booted to generate the track_list.json files. If this is not run browser2 will get a 404 and not function.