kiwix / kiwix-xulrunner

[ARCHIVED] Legacy Kiwix desktop solution for Windows/macOS/Linux
https://download.kiwix.org/release/kiwix-xulrunner/
GNU General Public License v3.0
111 stars 28 forks source link

Provide Android content update notification #306

Closed kelson42 closed 7 years ago

kelson42 commented 8 years ago

I have implemented last WE the support of the ZIM metadata "name". The name being a string which is table over ZIM revisions.

This should allow to display a notification to the user if the a content has been updated. I could so in one click download an updated version of the content.

For now, I do not have published officially ZIM files with this metadata, but I have provided a demo file which can be used for dev purposes here: http://tmp.kiwix.org/zim%2bftindex/wikipedia_bm_all_nopic_2016-09.zim.

kelson42 commented 8 years ago

The first ZIM files with this new tags have been created and in library.xml.

mhutti1 commented 7 years ago

@kelson42 So one way of finding this out is to download the 6mb file every time we want to check. That isn't very efficient though. It might be a good idea to create a serverside script that we can query to tell us if there is an update. e.g kiwix.org/testscript?zim_name=name&current_version=2016-10 giving either false or the url of the download.

kelson42 commented 7 years ago

@mhutti1 Indeed, we need to have a new version of the library. But I would not force anyway the download of it because of this. Ideally if would be a hook dealing with this (showing the notification) each time the library is updated. On the longer term (6 months), the OPDS implementation will allow to deal with this more elegantly (in a similar way like you propose).

How works the solution you have implemented?

mhutti1 commented 7 years ago

@kelson42 Well i'm to expert but a small piece of server side code (e.g php) running on a server somewhere would cache the library every day and parse it to find the version code and url of the ZIM files in it. Then our app would (at most once a day) when it starts send a request to the server in JSON telling it the versions and names of any ZIM files on the device. The server would then check this with its XML file and return a JSON object containing the names and corresponding download links to any updated files that would then be turned into a notification by our app. (It would also add an update button to the local ZIM list.

kelson42 commented 7 years ago

@mhutti1 Ok, so lets pospone this to the time OPDS will be implemented.

tbertels commented 7 years ago

To lower the server usage, static files could be used instead. They would be created each time a zim is updated and they would contain the last version of their respective zim file. Since that doesn't require to run a server script for each request, it lowers the server load and makes the requests much faster, especially with a lot of concurrent requests. An example of file, for wikipedia_en_all_nopic would be wikipedia_en_all_nopic.ver, containing by example 2016-12 Kiwix would just compare it to its file.

mhutti1 commented 7 years ago

@tbertels This would still require either manual curation or a serverside script to create these static files though.

tbertels commented 7 years ago

Yes, a script that could be run at the end of each zim creation or once everyday.

mhutti1 commented 7 years ago

This issue was moved to kiwix/kiwix-android#57