From 9a877378c9a348e948fb6b6c46beef6d1391d7d3 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 14 Sep 2023 02:01:08 +0300 Subject: [PATCH] refresh /orgy automatically --- files/assets/js/orgy_file.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/files/assets/js/orgy_file.js b/files/assets/js/orgy_file.js index acf6d57d5..9c6d8796e 100644 --- a/files/assets/js/orgy_file.js +++ b/files/assets/js/orgy_file.js @@ -38,3 +38,12 @@ orgy_file.addEventListener("timeupdate", function(){ }, 300000); } }); + +const now = new Date(); +const now_utc = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds()); + +let millis = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), 0, 0, 10) - now; +if (millis < 0) + millis += 86400000; + +setTimeout(() => location.reload(), millis);