From 71291d47cd8e39a9686e97f6c1e9022b8ed933b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Izzo?= Date: Fri, 19 May 2017 15:29:41 +0200 Subject: [PATCH] Added update button to web interface. Added a mapping to the gplaycli function which updates all the downloaded apks. Set the cli.yes flag to avoid timeouts due to missing command line confirmation. One thing to improve is that when all the apps are up to date, the web app returns ERR_EMPTY_RESPONSE, while it would be nice to have a message printed on the webpage. --- gplayweb | 8 ++++++++ gplayweb.conf.example | 1 + templates/base.html | 1 + 3 files changed, 10 insertions(+) diff --git a/gplayweb b/gplayweb index 590b97c..936b32f 100755 --- a/gplayweb +++ b/gplayweb @@ -51,6 +51,8 @@ class MainHandler(tornado.web.RequestHandler): self.empty_cache() elif page == 'fdroid-forceupdate': self.fdroid_forceupdate() + elif page == 'updateapks': + self.update_apks() else: return @@ -109,6 +111,10 @@ class MainHandler(tornado.web.RequestHandler): self.update_fdroid() self.redirect('list') + def update_apks(self): + self.cli.prepare_analyse_apks() + self.redirect('list') + # Search an apk by string def search(self): search_string = self.get_argument('name', None) @@ -270,6 +276,8 @@ def main(): # Parsing conffile cli = GPlaycli(cli_args.CONFFILE) + # Auto confirm cli actions + cli.yes = True # Connect to API cli.connect_to_googleplay_api() diff --git a/gplayweb.conf.example b/gplayweb.conf.example index 73edba0..ca5eba3 100644 --- a/gplayweb.conf.example +++ b/gplayweb.conf.example @@ -3,6 +3,7 @@ gmail_password=zHbdWdWtvdQAfylf android_ID=3d716411bf8bc802 gmail_address=fdroidserver@gmail.com language=fr_FR +download_folder_path=/data/fdroid/repo [Server] folder=/data/fdroid/repo root_url=/ diff --git a/templates/base.html b/templates/base.html index 0d0de91..af1d098 100644 --- a/templates/base.html +++ b/templates/base.html @@ -92,6 +92,7 @@

GPlayWeb: A web interface for GPlayCli

  • Download
  • Fdroid force update
  • Clear cache
  • +
  • Update APKs