release: Multi-Hoster-Upload 2.1.1

Add live English and German interface switching, animated navigation and history controls, improved update changelogs, remembered upload folders, reliable repeated hot reloads, and refreshed public documentation.
This commit is contained in:
Sucukdeluxe
2026-08-10 18:31:35 +02:00
parent d8e4a2d203
commit dc744ec6f3
19 changed files with 1658 additions and 88 deletions
+31 -2
View File
@@ -6,6 +6,7 @@ const { app } = require('electron');
const UPDATE_REPO = 'Administrator/Multi-Hoster-Upload';
const GITEA_BASE = 'https://git.24-music.de';
const API_URL = `${GITEA_BASE}/api/v1/repos/${UPDATE_REPO}/releases?limit=1`;
const GITHUB_RELEASE_URL = 'https://api.github.com/repos/Sucukdeluxe/Multi-Hoster-Upload/releases/tags';
const CHECK_TIMEOUT = 15000;
@@ -86,6 +87,33 @@ async function fetchJson(url, signal) {
}
}
async function fetchGithubReleaseNotes(remoteVersion, fallback = '', fetchImpl = fetch) {
const version = String(remoteVersion || '').replace(/^v/i, '').trim();
if (!/^\d+\.\d+\.\d+$/.test(version)) return String(fallback || '');
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), CHECK_TIMEOUT);
try {
const response = await fetchImpl(`${GITHUB_RELEASE_URL}/v${version}`, {
method: 'GET',
redirect: 'follow',
signal: controller.signal,
headers: {
Accept: 'application/vnd.github+json',
'X-GitHub-Api-Version': '2022-11-28',
'User-Agent': 'Multi-Hoster-Upload'
}
});
if (!response.ok) return String(fallback || '');
const release = await response.json();
const notes = typeof release?.body === 'string' ? release.body.trim() : '';
return notes || String(fallback || '');
} catch {
return String(fallback || '');
} finally {
clearTimeout(timeout);
}
}
async function checkForUpdate() {
// Return cached result if fresh
if (cachedCheck && (Date.now() - cachedCheckTs) < CACHE_TTL) {
@@ -116,6 +144,7 @@ async function checkForUpdate() {
return { available: false, reason: 'Kein Setup-Asset im Release gefunden' };
}
const releaseNotes = await fetchGithubReleaseNotes(remoteVersion, release.body || '');
cachedCheck = {
available: true,
currentVersion,
@@ -126,7 +155,7 @@ async function checkForUpdate() {
assetSize: setupAsset.size,
assetName: setupAsset.name,
latestYmlUrl: latestYml ? latestYml.browser_download_url : null,
releaseNotes: release.body || ''
releaseNotes
};
cachedCheckTs = Date.now();
return cachedCheck;
@@ -293,4 +322,4 @@ function abortUpdate() {
}
}
module.exports = { checkForUpdate, prepareUpdate, launchPreparedUpdate, abortUpdate, isNewer, resolveReleaseVersion };
module.exports = { checkForUpdate, fetchGithubReleaseNotes, prepareUpdate, launchPreparedUpdate, abortUpdate, isNewer, resolveReleaseVersion };