feat: init 2.0.0 config file edit

This commit is contained in:
shinya
2025-08-13 00:30:31 +08:00
parent 8b9be4bb19
commit f0e171e71f
14 changed files with 671 additions and 3060 deletions

17
src/lib/config.client.ts Normal file
View File

@@ -0,0 +1,17 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
'use client';
export async function getCustomCategories(): Promise<{
name: string;
type: 'movie' | 'tv';
query: string;
}[]> {
const res = await fetch('/api/config/custom_category');
const data = await res.json();
return data.filter((item: any) => !item.disabled).map((category: any) => ({
name: category.name || '',
type: category.type,
query: category.query,
}));
}