From 3a4b781d4e8386d90f5457798bbae3af5bdc6418 Mon Sep 17 00:00:00 2001 From: EccoB Date: Fri, 23 Oct 2020 21:19:49 +0200 Subject: [PATCH 1/3] Implemented continous check for new pictures in gallery.php --- gallery.php | 11 ++++++++ lib/db.php | 7 +++++ resources/js/gallery_updatecheck.js | 42 +++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 resources/js/gallery_updatecheck.js diff --git a/gallery.php b/gallery.php index 432a514e1..82eba9c7c 100644 --- a/gallery.php +++ b/gallery.php @@ -3,6 +3,16 @@ require_once('lib/config.php'); require_once('lib/db.php'); +// Check if there is a request for the status of the database +if (isset($_GET['status'])){ + // Request for DB-Status, + // Currently reports back the DB-Size to give the Client the ability + // to detect changes + $resp = array('dbsize'=>getDBSize()); + exit(json_encode($resp)); + +} + $images = getImagesFromDB(); $imagelist = ($config['newest_first'] === true) ? array_reverse($images) : $images; ?> @@ -88,6 +98,7 @@ +