diff options
author | 2024-04-05 17:39:38 +0200 | |
---|---|---|
committer | 2024-04-05 17:39:38 +0200 | |
commit | b3ac1d176ce9f4778986190702216f0f25918a70 (patch) | |
tree | 65f47485f650af096576e4f055b4bbf4760090b9 /lib | |
parent | d5aa3aef699b400d5b40d61ee45c4476f0fcb38e (diff) | |
download | rss-bridge-b3ac1d176ce9f4778986190702216f0f25918a70.tar.gz rss-bridge-b3ac1d176ce9f4778986190702216f0f25918a70.tar.zst rss-bridge-b3ac1d176ce9f4778986190702216f0f25918a70.zip |
[FDroidRepoBridge] Simplify json retrieval (#4063)
* [FDroidRepoBridge] Simplify json retrieval
I looked into avoiding the writing-to-file and then reading-from-file altogether. Using a special file path that leaves the data in memory probably wouldn't work. But I'm unsure why we use the `index-v1.jar` file altogether.
The main F-Droid repo [lists](https://f-droid.org/en/docs/All_our_APIs/#the-repo-index) not only `index-v1.jar` (which only makes sense if we were to use the contained signature, which we don't), but also `index-v1.json` and `index-v2.json`. These json files can be fetched with `getContents`, optionally cached, and directly fed into `Json::decode` without using a temporary file. The HTTP transfer encoding can compress the file to a similar degree the jar (=zip) can. That's exactly what this commit uses.
Now the question is whether all the F-Droid repositories out there have this file. I went through the whole [list of known repositories](https://forum.f-droid.org/t/known-repositories/721) and only one repo misses the `index-v1.json` file: [Bromite](https://fdroid.bromite.org/fdroid/repo/index-v1.json). Under these circumstances we can depend on the availability of the `index-v1.json` file.
Closes #4062
* [FDroidRepoBridge] Cleanup not requiring Zip
With the last commit 1152386678151aeafd984061d34248023378bf64, the zip
extension is not required anymore. Don't fail if it's not available.
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions