Create Kaleido Desktop, a cinematic Plex client for Windows
Tauri 2 shell with a React/TypeScript interface and libmpv playback composed beneath the web view (DirectComposition on Windows). Shared code with per-OS platform modules and configs so macOS and Linux can follow. - Plex sign-in (browser, plex.tv/link or manual), server selection, Plex Home - Home, Movies and TV Shows (Discover, Library, Collections), search, people - Title pages with logos, ratings, cast, extras, seasons and episodes - Direct play with Plex conversion fallback, tracks, markers, autoplay - Metadata editing, artwork, fix match, refresh, analyze and deletion - Resumable offline downloads - App settings and Plex server administration with a live dashboard - Signed updater feed and Forgejo CI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
00d72e70f4
121 changed files with 25315 additions and 0 deletions
30
scripts/build.ps1
Normal file
30
scripts/build.ps1
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Builds Kaleido for Windows: the NSIS installer plus signed updater artifacts.
|
||||
# .\scripts\build.ps1 # release installer
|
||||
# .\scripts\build.ps1 -Debug # faster unoptimized build
|
||||
param([switch]$Debug)
|
||||
$ErrorActionPreference = "Stop"
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
Set-Location $root
|
||||
|
||||
& "$PSScriptRoot\fetch-libmpv.ps1"
|
||||
|
||||
# The updater signing key stays outside git (.tools/). CI provides it as a secret.
|
||||
if (-not $env:TAURI_SIGNING_PRIVATE_KEY) {
|
||||
$keyFile = Join-Path $root ".tools\updater.key"
|
||||
if (Test-Path $keyFile) {
|
||||
$env:TAURI_SIGNING_PRIVATE_KEY = Get-Content $keyFile -Raw
|
||||
if (-not $env:TAURI_SIGNING_PRIVATE_KEY_PASSWORD) { $env:TAURI_SIGNING_PRIVATE_KEY_PASSWORD = "" }
|
||||
} else {
|
||||
Write-Warning "No updater signing key; building without update artifacts."
|
||||
$env:TAURI_CONFIG = '{"bundle":{"createUpdaterArtifacts":false}}'
|
||||
}
|
||||
}
|
||||
|
||||
if (-not (Test-Path (Join-Path $root "node_modules"))) { npm ci }
|
||||
$buildArgs = @("tauri", "build")
|
||||
if ($Debug) { $buildArgs += "--debug" }
|
||||
npx @buildArgs
|
||||
if ($LASTEXITCODE -ne 0) { throw "Build failed" }
|
||||
|
||||
$profile = if ($Debug) { "debug" } else { "release" }
|
||||
Get-ChildItem (Join-Path $root "src-tauri\target\$profile\bundle\nsis") | Select-Object Name, Length
|
||||
15
scripts/fetch-libmpv.ps1
Normal file
15
scripts/fetch-libmpv.ps1
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Downloads libmpv for Windows into vendor/mpv/windows.
|
||||
# Source: https://github.com/shinchiro/mpv-winbuild-cmake (the builds linked from mpv.io).
|
||||
param([string]$Tag = "20261021", [string]$Build = "mpv-dev-x86_64-20261021-git-e471496c56")
|
||||
$ErrorActionPreference = "Stop"
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$dest = Join-Path $root "vendor\mpv\windows"
|
||||
if (Test-Path (Join-Path $dest "libmpv-2.dll")) { Write-Host "libmpv already present in $dest"; exit 0 }
|
||||
$tmp = Join-Path ([IO.Path]::GetTempPath()) ("kaleido-mpv-" + [guid]::NewGuid())
|
||||
New-Item -ItemType Directory -Force $tmp, $dest | Out-Null
|
||||
$archive = Join-Path $tmp "mpv-dev.7z"
|
||||
Invoke-WebRequest "https://github.com/shinchiro/mpv-winbuild-cmake/releases/download/$Tag/$Build.7z" -OutFile $archive
|
||||
& 7z x $archive "-o$tmp\x" -y | Out-Null
|
||||
Copy-Item "$tmp\x\libmpv-2.dll" $dest
|
||||
Remove-Item -Recurse -Force $tmp
|
||||
Write-Host "libmpv installed to $dest"
|
||||
15
scripts/fetch-libmpv.sh
Normal file
15
scripts/fetch-libmpv.sh
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env sh
|
||||
# macOS: copies Homebrew's libmpv into vendor/mpv/macos for bundling.
|
||||
# Linux: libmpv comes from the system package (libmpv2); nothing to copy.
|
||||
set -eu
|
||||
root=$(cd "$(dirname "$0")/.." && pwd)
|
||||
case "$(uname -s)" in
|
||||
Darwin)
|
||||
brew list mpv >/dev/null 2>&1 || brew install mpv
|
||||
mkdir -p "$root/vendor/mpv/macos"
|
||||
cp "$(brew --prefix mpv)/lib/libmpv.2.dylib" "$root/vendor/mpv/macos/"
|
||||
echo "libmpv copied to vendor/mpv/macos" ;;
|
||||
Linux)
|
||||
echo "Install libmpv from your distribution (e.g. apt install libmpv2 libmpv-dev)." ;;
|
||||
*) echo "Use scripts/fetch-libmpv.ps1 on Windows." ;;
|
||||
esac
|
||||
47
scripts/update-manifest.mjs
Normal file
47
scripts/update-manifest.mjs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
// Writes updates/latest.json, the feed Kaleido's updater reads, from built bundles.
|
||||
// Usage: node scripts/update-manifest.mjs <version> <baseDownloadUrl> [notesFile]
|
||||
// Each platform's signed artifact (and its .sig) must be in src-tauri/target/release/bundle,
|
||||
// or pass several bundle folders via KALEIDO_BUNDLES (path;path) when collecting CI outputs.
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const [version, baseUrl, notesFile] = process.argv.slice(2);
|
||||
if (!version || !baseUrl) {
|
||||
console.error('usage: node scripts/update-manifest.mjs <version> <baseDownloadUrl> [notesFile]');
|
||||
process.exit(1);
|
||||
}
|
||||
const root = path.resolve(import.meta.dirname, '..');
|
||||
const bundles = (process.env.KALEIDO_BUNDLES ?? path.join(root, 'src-tauri/target/release/bundle')).split(';');
|
||||
|
||||
/** Tauri updater platform keys and the artifact each one installs. */
|
||||
const PLATFORMS = [
|
||||
{ key: 'windows-x86_64', dir: 'nsis', match: /-setup\.exe$/ },
|
||||
{ key: 'darwin-aarch64', dir: 'macos', match: /aarch64.*\.app\.tar\.gz$/ },
|
||||
{ key: 'darwin-x86_64', dir: 'macos', match: /x64.*\.app\.tar\.gz$/ },
|
||||
{ key: 'linux-x86_64', dir: 'appimage', match: /\.AppImage$/ },
|
||||
];
|
||||
|
||||
const manifestPath = path.join(root, 'updates/latest.json');
|
||||
const manifest = fs.existsSync(manifestPath) ? JSON.parse(fs.readFileSync(manifestPath, 'utf8')) : { platforms: {} };
|
||||
manifest.version = version;
|
||||
manifest.notes = notesFile ? fs.readFileSync(notesFile, 'utf8').trim() : manifest.notes ?? '';
|
||||
manifest.pub_date = new Date().toISOString();
|
||||
manifest.platforms ??= {};
|
||||
|
||||
for (const bundle of bundles) {
|
||||
for (const p of PLATFORMS) {
|
||||
const dir = path.join(bundle, p.dir);
|
||||
if (!fs.existsSync(dir)) continue;
|
||||
const file = fs.readdirSync(dir).find((f) => p.match.test(f) && f.includes(version));
|
||||
if (!file || !fs.existsSync(path.join(dir, `${file}.sig`))) continue;
|
||||
manifest.platforms[p.key] = {
|
||||
signature: fs.readFileSync(path.join(dir, `${file}.sig`), 'utf8').trim(),
|
||||
url: `${baseUrl.replace(/\/$/, '')}/${encodeURIComponent(file)}`,
|
||||
};
|
||||
console.log(`${p.key}: ${file}`);
|
||||
}
|
||||
}
|
||||
|
||||
fs.mkdirSync(path.dirname(manifestPath), { recursive: true });
|
||||
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
|
||||
console.log(`Wrote ${path.relative(root, manifestPath)}`);
|
||||
Loading…
Add table
Add a link
Reference in a new issue