mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-20 15:20:39 -07:00
Add dynamic download redirect routes and update README links
This commit is contained in:
@@ -78,11 +78,13 @@ Voicebox is a **local-first voice cloning studio** — a free and open-source al
|
|||||||
|
|
||||||
| Platform | Download |
|
| Platform | Download |
|
||||||
|----------|----------|
|
|----------|----------|
|
||||||
| macOS (Apple Silicon) | [Download DMG](https://github.com/jamiepine/voicebox/releases/latest/download/Voicebox_aarch64.dmg) |
|
| macOS (Apple Silicon) | [Download DMG](https://voicebox.sh/download/mac-arm) |
|
||||||
| macOS (Intel) | [Download DMG](https://github.com/jamiepine/voicebox/releases/latest/download/Voicebox_x64.dmg) |
|
| macOS (Intel) | [Download DMG](https://voicebox.sh/download/mac-intel) |
|
||||||
| Windows | [Latest Release](https://github.com/jamiepine/voicebox/releases/latest) |
|
| Windows | [Download MSI](https://voicebox.sh/download/windows) |
|
||||||
| Docker | `docker compose up` |
|
| Docker | `docker compose up` |
|
||||||
|
|
||||||
|
> **[View all binaries →](https://github.com/jamiepine/voicebox/releases/latest)**
|
||||||
|
|
||||||
> **Linux** — Pre-built binaries are not yet available. See [voicebox.sh/linux-install](https://voicebox.sh/linux-install) for build-from-source instructions.
|
> **Linux** — Pre-built binaries are not yet available. See [voicebox.sh/linux-install](https://voicebox.sh/linux-install) for build-from-source instructions.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import { type NextRequest, NextResponse } from 'next/server';
|
||||||
|
import { getLatestRelease } from '@/lib/releases';
|
||||||
|
|
||||||
|
export const dynamic = 'force-dynamic';
|
||||||
|
|
||||||
|
const PLATFORM_MAP: Record<
|
||||||
|
string,
|
||||||
|
keyof Awaited<ReturnType<typeof getLatestRelease>>['downloadLinks']
|
||||||
|
> = {
|
||||||
|
'mac-arm': 'macArm',
|
||||||
|
'mac-intel': 'macIntel',
|
||||||
|
windows: 'windows',
|
||||||
|
linux: 'linux',
|
||||||
|
};
|
||||||
|
|
||||||
|
export async function GET(
|
||||||
|
_request: NextRequest,
|
||||||
|
{ params }: { params: Promise<{ platform: string }> },
|
||||||
|
) {
|
||||||
|
const { platform } = await params;
|
||||||
|
const key = PLATFORM_MAP[platform];
|
||||||
|
|
||||||
|
if (!key) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{ error: `Unknown platform: ${platform}. Use: ${Object.keys(PLATFORM_MAP).join(', ')}` },
|
||||||
|
{ status: 404 },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const release = await getLatestRelease();
|
||||||
|
const url = release.downloadLinks[key];
|
||||||
|
|
||||||
|
if (!url) {
|
||||||
|
return NextResponse.json({ error: `No download available for ${platform}` }, { status: 404 });
|
||||||
|
}
|
||||||
|
|
||||||
|
return NextResponse.redirect(url);
|
||||||
|
} catch {
|
||||||
|
return NextResponse.redirect(`https://github.com/jamiepine/voicebox/releases/latest`);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user