Remove existence checks and fallbacks for files that always exist #4544
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove existence checks and fallbacks for files that always exist
Pull Request Type
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
Desktop