From 9cad6eb1362a39fbb9055fd3b72a35efe5c7dd60 Mon Sep 17 00:00:00 2001 From: Local Dev Date: Sun, 4 Oct 2026 22:49:46 +0200 Subject: [PATCH] Pithos desktop: update notices per platform With Linux builds joining Windows in the release list, the check must only compare builds for its own system, and the link must fetch the Linux AppImage (or, later, the macOS dmg) rather than the Windows installer. --- core/server.js | 5 ++++- ui/app.js | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/server.js b/core/server.js index 527fd9c..49b6199 100644 --- a/core/server.js +++ b/core/server.js @@ -166,6 +166,7 @@ export async function createPithos(opts = {}) { pithos: pithosVersion, // electron-builder's portable exe sets this; updates then fetch the portable build. portable: hostName === 'desktop' && !!process.env.PORTABLE_EXECUTABLE_FILE, + platform: process.platform, daemon: daemon.status(), external: await probeExternal(c), s3d: { ...v, pinned: S3D_VERSION, installable: !!assetForPlatform(), outdated: !!(v?.version && cmpVersion(v.version, S3D_VERSION) < 0) }, @@ -540,7 +541,9 @@ export async function createPithos(opts = {}) { if (releaseCache && Date.now() - releaseCache.at < 10 * 60_000 && url.searchParams.get('fresh') !== '1') return releaseCache.body; const res = await fetch(`${RELEASES_URL}?t=${Math.floor(Date.now() / 60000)}`, { cache: 'no-store', signal: AbortSignal.timeout(15_000) }).catch((e) => { throw new HttpError(502, e.message); }); if (!res.ok) throw new HttpError(502, `the release list answered ${res.status}`); - const list = ((await res.json())?.releases || []).filter((e) => e.id === 'pithos-desktop' && /^\d+\.\d+\.\d+$/.test(e.version)); + // each build is listed per platform ("win-x64", "linux-x64", "mac-…"); only ours counts + const os = { win32: 'win', linux: 'linux', darwin: 'mac' }[process.platform]; + const list = ((await res.json())?.releases || []).filter((e) => e.id === 'pithos-desktop' && /^\d+\.\d+\.\d+$/.test(e.version) && String(e.platform || '').startsWith(`${os}-`)); const latest = list.reduce((best, e) => (!best || cmpVersion(e.version, best.version) > 0 ? e : best), null); const body = { latest: latest && { version: latest.version, date: latest.date || null, changes: String(latest.changes || '').slice(0, 600) } }; releaseCache = { at: Date.now(), body }; diff --git a/ui/app.js b/ui/app.js index fde8338..65c9829 100644 --- a/ui/app.js +++ b/ui/app.js @@ -2570,7 +2570,8 @@ const UPDATES_URL = 'https://navigate.st/bns/theseus.x/extensions/pithos/updates // (read by the local server). The chip downloads the matching installer, or // the portable exe, in the browser. function desktopUpdates(current, { ver, chip, check }) { - const file = state.status?.portable ? 'Pithos-portable.exe' : 'Pithos-Setup.exe'; + const plat = state.status?.platform; + const file = plat === 'linux' ? 'Pithos.AppImage' : plat === 'darwin' ? 'Pithos.dmg' : state.status?.portable ? 'Pithos-portable.exe' : 'Pithos-Setup.exe'; const rest = () => { chip.hidden = true; ver.hidden = false; }; const flash = (text, cls, title) => { chip.hidden = false; ver.hidden = true; chip.className = `brandupd ${cls}`; chip.textContent = text; chip.title = title || ''; chip.disabled = true; chip.onclick = null;