Remove existence checks and fallbacks for files that always exist
Remove existence checks and fallbacks for files that always exist
Pull Request Type
- [x] Other - Performance Improvement
Description
Currently we check if the invidious fallback instances file, the external player data file and the geolocation files exist on the filesystem before loading them, however as they are in the source code repository and bundled with FreeTube, they will always exist unless someone goes out of the way to remove them from the FreeTube bundle or accidentally deletes them during development. So I think it's fine to remove the checks and fallbacks, because if they are actually missing, you'll actually get an error message, so that you know about the problem, instead of the silent fallback that we currently have.
For the geolocation files we do actually need to check if one exists in the display language, so that we can fallback to the en-US one if it doesn't, to keep that working I decided to copy the behaviour of the web build, which embeds a list of known files at build time, allowing use to just check the array instead of doing the runtime file system check every time.
Testing
- Change the display language and check that the list of regions for trending still gets updated
- Check that opening an external player still works
Desktop
- OS: Windows
- OS Version: 10
- FreeTube version: 0.19.1