Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
pdmarf
2026-04-21 18:35:50 +01:00
parent e34394c1b4
commit 8d63a6c7c4
5 changed files with 24 additions and 16 deletions

View File

@@ -6438,18 +6438,22 @@ async function stopTimer(token, entryId) {
}
// src/plugin.ts
var CURRENT_VERSION = "1.0.17";
var CURRENT_VERSION = "1.0.18";
var GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/master";
var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
-----END PUBLIC KEY-----`;
function isNewerVersion(remote, current) {
const parse = (v) => v.split(".").map(Number);
const [rMaj, rMin, rPat] = parse(remote);
const [cMaj, cMin, cPat] = parse(current);
if (rMaj !== cMaj) return rMaj > cMaj;
if (rMin !== cMin) return rMin > cMin;
return rPat > cPat;
const r = parse(remote);
const c = parse(current);
const len = Math.max(r.length, c.length);
for (let i = 0; i < len; i++) {
const rv = r[i] ?? 0;
const cv = c[i] ?? 0;
if (rv !== cv) return rv > cv;
}
return false;
}
function fetchWithTimeout2(url) {
const controller = new AbortController();
@@ -6464,7 +6468,7 @@ async function checkForUpdates(sendStatus) {
return;
}
const { version } = await resp.json();
if (!/^\d+\.\d+\.\d+$/.test(version)) return;
if (!/^\d+(\.\d+)+$/.test(version)) return;
if (!isNewerVersion(version, CURRENT_VERSION)) {
sendStatus?.(`Already up to date (v${CURRENT_VERSION})`);
return;

View File

@@ -1 +1 @@
ĹŁĹbŃ3¶ś¤žNEńŰÇ(¦«T%,wţčÔđŁŇ҉˙ř,vźW7§UĎ<55>ŹrWÝŢĂ&")ŰK„
hГj5±йЫщ$r!ѕяЩc•яржd<D0B6>ЭТ]kэ“oЪlігцёШЇ<14>iЛБHГо©* ’ћ;»Џъ<D08F> Чc 

Binary file not shown.

View File

@@ -1,4 +1,4 @@
const CURRENT_VERSION = "1.0.17";
const CURRENT_VERSION = "1.0.18";
const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/master";
const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
@@ -6,11 +6,15 @@ MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
function isNewerVersion(remote: string, current: string): boolean {
const parse = (v: string) => v.split(".").map(Number);
const [rMaj, rMin, rPat] = parse(remote);
const [cMaj, cMin, cPat] = parse(current);
if (rMaj !== cMaj) return rMaj > cMaj;
if (rMin !== cMin) return rMin > cMin;
return rPat > cPat;
const r = parse(remote);
const c = parse(current);
const len = Math.max(r.length, c.length);
for (let i = 0; i < len; i++) {
const rv = r[i] ?? 0;
const cv = c[i] ?? 0;
if (rv !== cv) return rv > cv;
}
return false;
}
function fetchWithTimeout(url: string): Promise<Response> {
@@ -24,7 +28,7 @@ async function checkForUpdates(sendStatus?: (msg: string) => void): Promise<void
const resp = await fetchWithTimeout(`${GITEA_BASE}/version.json`);
if (!resp.ok) { sendStatus?.("Update check failed"); return; }
const { version } = await resp.json() as { version: string };
if (!/^\d+\.\d+\.\d+$/.test(version)) return;
if (!/^\d+(\.\d+)+$/.test(version)) return;
if (!isNewerVersion(version, CURRENT_VERSION)) {
sendStatus?.(`Already up to date (v${CURRENT_VERSION})`);
return;

View File

@@ -1 +1 @@
{ "version": "1.0.17" }
{ "version": "1.0.18" }