0
0
mirror of https://github.com/TrianguloY/UrlChecker.git synced 2024-09-19 20:02:16 +02:00

dynamically update timestamp of assets

fixes #374
This commit is contained in:
TrianguloY 2024-08-19 18:16:45 +02:00
parent a322a1f801
commit 5eb9e5a45e
2 changed files with 11 additions and 2 deletions

View File

@ -89,9 +89,18 @@ jobs:
exit 1
fi
# create and push commit with the new file
# at this point we know the new file is different from the last because hashes are different (old==remote!=new)
git add "$FILE_PATH"
# update the timestamp
marker="/\*$FILE_NAME-timestamp\*/"
grep -rli "$marker" * | while read file ; do
echo "Updating timestamp from file $file"
sed -i "s|$marker\(.*\)$marker|$marker$(date +%s)000L$marker|" "$file"
git add "$file"
done
# create and push commit with the changes
git commit -m "
[action] Updated $FILE_NAME

View File

@ -60,7 +60,7 @@ public class ClearUrlCatalog {
catalogURL = new GenericPref.Str("clearurl_catalogURL", "https://rules2.clearurls.xyz/data.minify.json", cntx);
hashURL = new GenericPref.Str("clearurl_hashURL", "https://rules2.clearurls.xyz/rules.minify.hash", cntx);
autoUpdate = new GenericPref.Bool("clearurl_autoUpdate", false, cntx);
lastUpdate = new GenericPref.Lng("clearurl_lastUpdate", 1661990400000L, cntx); // time when the data.minify.json asset file was updated (floored to previous UTC day)
lastUpdate = new GenericPref.Lng("clearurl_lastUpdate", /*data.minify.json-timestamp*/1716151560000L/*data.minify.json-timestamp*/, cntx);
lastCheck = new GenericPref.Lng("clearurl_lastCheck", -1L, cntx);
lastAuto = new GenericPref.Bool("clearurl_lastAuto", false, cntx);