Sync layouts, typography, and watermark studio for self-hosted OSS.
Unlock features without credits/Stripe, point docs to docs.songs2vid.com, and drop leftover billing admin surfaces. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+11
-3
@@ -1,9 +1,17 @@
|
||||
import { Plan } from "@prisma/client";
|
||||
|
||||
/**
|
||||
* Self-hosted / OSS edition. Prefer S2VID_EDITION; S2YT_EDITION kept for older compose files.
|
||||
*/
|
||||
export function isSelfHostedEdition(): boolean {
|
||||
return process.env.S2YT_EDITION === "selfhosted";
|
||||
const edition =
|
||||
process.env.S2VID_EDITION?.trim() || process.env.S2YT_EDITION?.trim() || "";
|
||||
// Default to self-hosted for this OSS package when unset
|
||||
if (!edition) return true;
|
||||
return edition === "selfhosted";
|
||||
}
|
||||
|
||||
export function hasProFeatures(plan: Plan): boolean {
|
||||
return isSelfHostedEdition() || plan === "PREMIUM";
|
||||
/** All Pro features are unlocked in the OSS / self-hosted edition. */
|
||||
export function hasProFeatures(_plan?: Plan): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user