Skip to content

armgit / VERT

Public Imported from GitHub
0

The next-generation file converter. Open source, fully local* and free forever.

977 B
Raw Blame
import { PUB_DISABLE_ALL_EXTERNAL_REQUESTS, PUB_ENV } from "$app/env/public";

export const GITHUB_URL_VERT = "https://github.com/VERT-sh/VERT";
export const GITHUB_URL_VERTD = "https://github.com/VERT-sh/vertd";
export const GITHUB_API_URL = "https://api.github.com/repos/VERT-sh/VERT";
export const DISCORD_URL = "https://discord.gg/kqevGxYPak";
export const VERT_NAME =
	{
		development: "VERT Local",
		nightly: "VERT Nightly",
	}[PUB_ENV as string] ?? "VERT.sh";
export const CONTACT_EMAIL = "[email protected]";

// i'm not entirely sure this should be in consts.ts, but it is technically a constant as .env is static for VERT
export const DISABLE_ALL_EXTERNAL_REQUESTS =
	PUB_DISABLE_ALL_EXTERNAL_REQUESTS === "true";

export const GB = 1024 * 1024 * 1024;

export function conversionConcurrency(): number {
	const cores =
		typeof navigator !== "undefined"
			? navigator.hardwareConcurrency || 4
			: 4;
	return Math.max(1, cores - 1); // leave one core free just cause
}