Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

feature (standalone gallery): continous check for new pictures #121

Merged
merged 4 commits into from Oct 27, 2020

Conversation

andi34
Copy link
Owner

@andi34 andi34 commented Oct 24, 2020

Prerequisites checklist

What is the purpose of this pull request? (put an "x" next to an item)

  • New feature

What changes did you make? (Give an overview)

From andreknieriem#260

Problem:
When the gallery is used standalone, new pictures won't be visible till the user manually refreshes the page.

Solution:
Added jQuery script that asks the server weather the database changed, if so the page will be reloaded automatically.

Implementation details:

  • Updates are detected by checking weather the file-size of the db.txt changed. For this, the db.php got a new function that returns the file-size.
  • Gallery.php returns a json response, including the db-file size, if the variable 'status' is set via GET method.
  • The regular ajax requests for this are done in a separate js-File (default: every 5s).

Further improvements:

  • we need to detect touch and mouse events and only refresh the page if there's no activity

Adjustments by Andreas Blaesius:

  • eslint fixes
  • adjustments to work on latest Photobooth
  • slightly adjust commit message
  • make optional available via admin panel
  • make refreshing time adjustable

Is there anything you'd like reviewers to focus on?

Adjustments by Andreas Blaesius:
- eslint fixes
- adjustments to work on latest Photobooth
- slightly adjust commit message

Change-Id: I58320492085549ad2975a4a10021567edfb02fc9
- Added public function to check for pending Timeouts in core.js
- Added check using that function in gallery update check

Change-Id: I64a72e0f4c10d593a84b2f22a93b2b58e240f14b
Change-Id: I9852814398bddb5ff714c3476dd3da1c359f693d
- also allow to adjust the time our database get checked for updates

Change-Id: Ic20cb370b0bd8b1c71c3885e2b3c035aba5ac9a9
@andi34 andi34 merged commit ca53acd into dev Oct 27, 2020
@andi34 andi34 deleted the feature/GalleryAutoRefresh branch October 27, 2020 09:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants