diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js b/com.pdma.notion-timer.sdPlugin/bin/plugin.js index 2c24e22..f72b632 100644 --- a/com.pdma.notion-timer.sdPlugin/bin/plugin.js +++ b/com.pdma.notion-timer.sdPlugin/bin/plugin.js @@ -6438,7 +6438,7 @@ async function stopTimer(token, entryId) { } // src/plugin.ts -var CURRENT_VERSION = "1.0.29"; +var CURRENT_VERSION = "1.0.30"; var GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild"; var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= @@ -6488,6 +6488,28 @@ async function checkForUpdates(sendStatus) { return; } const fs3 = await import("fs"); + const path5 = await import("path"); + const pluginRoot = path5.join(path5.dirname(__filename), ".."); + const ASSETS = [ + "ui/property-inspector.html", + "ui/global-property-inspector.html", + "imgs/idle.png", + "imgs/running.png" + ]; + const PLUGIN_BASE = `${GITEA_BASE}/com.pdma.notion-timer.sdPlugin`; + const assetResps = await Promise.all(ASSETS.map((p) => fetchWithTimeout2(`${PLUGIN_BASE}/${p}`))); + for (let i = 0; i < ASSETS.length; i++) { + if (assetResps[i].ok) { + fs3.writeFileSync(path5.join(pluginRoot, ASSETS[i]), Buffer.from(await assetResps[i].arrayBuffer())); + } + } + const LEGACY = ["imgs/idle.svg", "imgs/running.svg"]; + for (const f of LEGACY) { + try { + fs3.unlinkSync(path5.join(pluginRoot, f)); + } catch { + } + } fs3.writeFileSync(__filename, newCode); plugin_default.logger.info(`Updated to ${version}, restarting\u2026`); process.exit(0); diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig index 8af79b6..b481ae9 100644 --- a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig +++ b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig @@ -1 +1 @@ -ÊÝJﳋ“ù«’ÑU(Ä…ö8äïøMJvš£–ÛHáXÁJ‚¨•é¹OõÎÁzì¹CÝÅC¥/Üõ6» \ No newline at end of file +U [ˆŸ®/˜‰ª.Cij+l.߆g0›hÙ¬þQ¨VšìX8Xú÷ cÅʯ­ÚxÙО°K/(ßÚ|¢ \ No newline at end of file diff --git a/com.pdma.notion-timer.sdPlugin/manifest.json b/com.pdma.notion-timer.sdPlugin/manifest.json index e251193..70fe186 100644 --- a/com.pdma.notion-timer.sdPlugin/manifest.json +++ b/com.pdma.notion-timer.sdPlugin/manifest.json @@ -2,7 +2,7 @@ "Author": "Pete Marfleet", "Description": "Toggle Notion time tracking for a project with a single button press.", "Name": "Notion Timer", - "Version": "1.0.29", + "Version": "1.0.30", "SDKVersion": 2, "Software": { "MinimumVersion": "5.0" }, "OS": [{ "Platform": "mac", "MinimumVersion": "10.11" }], diff --git a/notion-timer.streamDeckPlugin b/notion-timer.streamDeckPlugin index abcf72f..c133364 100644 Binary files a/notion-timer.streamDeckPlugin and b/notion-timer.streamDeckPlugin differ diff --git a/src/plugin.ts b/src/plugin.ts index 2a77f8c..5019cf8 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,4 +1,4 @@ -const CURRENT_VERSION = "1.0.29"; +const CURRENT_VERSION = "1.0.30"; const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild"; const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= @@ -49,6 +49,30 @@ async function checkForUpdates(sendStatus?: (msg: string) => void): Promise fetchWithTimeout(`${PLUGIN_BASE}/${p}`))); + for (let i = 0; i < ASSETS.length; i++) { + if (assetResps[i].ok) { + fs.writeFileSync(path.join(pluginRoot, ASSETS[i]), Buffer.from(await assetResps[i].arrayBuffer())); + } + } + + // Remove legacy SVG icons that persist on disk after Stream Deck merge-installs + const LEGACY = ["imgs/idle.svg", "imgs/running.svg"]; + for (const f of LEGACY) { + try { fs.unlinkSync(path.join(pluginRoot, f)); } catch { /* already gone */ } + } + fs.writeFileSync(__filename, newCode); streamDeck.logger.info(`Updated to ${version}, restarting…`); process.exit(0); diff --git a/version.json b/version.json index 97dc089..2ebd68b 100644 --- a/version.json +++ b/version.json @@ -1 +1 @@ -{ "version": "1.0.29" } +{ "version": "1.0.30" }