@@ -6438,18 +6438,22 @@ async function stopTimer(token, entryId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// src/plugin.ts
|
// 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 GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/master";
|
||||||
var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
||||||
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
||||||
-----END PUBLIC KEY-----`;
|
-----END PUBLIC KEY-----`;
|
||||||
function isNewerVersion(remote, current) {
|
function isNewerVersion(remote, current) {
|
||||||
const parse = (v) => v.split(".").map(Number);
|
const parse = (v) => v.split(".").map(Number);
|
||||||
const [rMaj, rMin, rPat] = parse(remote);
|
const r = parse(remote);
|
||||||
const [cMaj, cMin, cPat] = parse(current);
|
const c = parse(current);
|
||||||
if (rMaj !== cMaj) return rMaj > cMaj;
|
const len = Math.max(r.length, c.length);
|
||||||
if (rMin !== cMin) return rMin > cMin;
|
for (let i = 0; i < len; i++) {
|
||||||
return rPat > cPat;
|
const rv = r[i] ?? 0;
|
||||||
|
const cv = c[i] ?? 0;
|
||||||
|
if (rv !== cv) return rv > cv;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
function fetchWithTimeout2(url) {
|
function fetchWithTimeout2(url) {
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
@@ -6464,7 +6468,7 @@ async function checkForUpdates(sendStatus) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { version } = await resp.json();
|
const { version } = await resp.json();
|
||||||
if (!/^\d+\.\d+\.\d+$/.test(version)) return;
|
if (!/^\d+(\.\d+)+$/.test(version)) return;
|
||||||
if (!isNewerVersion(version, CURRENT_VERSION)) {
|
if (!isNewerVersion(version, CURRENT_VERSION)) {
|
||||||
sendStatus?.(`Already up to date (v${CURRENT_VERSION})`);
|
sendStatus?.(`Already up to date (v${CURRENT_VERSION})`);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
ĹŁĹbŃ3¶ś¤žNEńŰÇ(¦«T%,wţčÔđŁŇ҉˙8Čř,vźW7§UĎ<55>ŹrWÝŢĂ&")ŰK„
|
hГj5±йЫщ$r!ѕяЩc•яржd<D0B6>‚ЭТ‘]kэ“oЪlігцёШЇ<14>iЛБHГо©* ’ћ;»Џъ<D08F> Чc
|
||||||
Binary file not shown.
@@ -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 GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/master";
|
||||||
const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
||||||
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
||||||
@@ -6,11 +6,15 @@ MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
|||||||
|
|
||||||
function isNewerVersion(remote: string, current: string): boolean {
|
function isNewerVersion(remote: string, current: string): boolean {
|
||||||
const parse = (v: string) => v.split(".").map(Number);
|
const parse = (v: string) => v.split(".").map(Number);
|
||||||
const [rMaj, rMin, rPat] = parse(remote);
|
const r = parse(remote);
|
||||||
const [cMaj, cMin, cPat] = parse(current);
|
const c = parse(current);
|
||||||
if (rMaj !== cMaj) return rMaj > cMaj;
|
const len = Math.max(r.length, c.length);
|
||||||
if (rMin !== cMin) return rMin > cMin;
|
for (let i = 0; i < len; i++) {
|
||||||
return rPat > cPat;
|
const rv = r[i] ?? 0;
|
||||||
|
const cv = c[i] ?? 0;
|
||||||
|
if (rv !== cv) return rv > cv;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchWithTimeout(url: string): Promise<Response> {
|
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`);
|
const resp = await fetchWithTimeout(`${GITEA_BASE}/version.json`);
|
||||||
if (!resp.ok) { sendStatus?.("Update check failed"); return; }
|
if (!resp.ok) { sendStatus?.("Update check failed"); return; }
|
||||||
const { version } = await resp.json() as { version: string };
|
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)) {
|
if (!isNewerVersion(version, CURRENT_VERSION)) {
|
||||||
sendStatus?.(`Already up to date (v${CURRENT_VERSION})`);
|
sendStatus?.(`Already up to date (v${CURRENT_VERSION})`);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{ "version": "1.0.17" }
|
{ "version": "1.0.18" }
|
||||||
|
|||||||
Reference in New Issue
Block a user