更多推荐增加tmdb源

This commit is contained in:
mtvpls
2025-12-27 23:45:34 +08:00
parent 36c1b87af4
commit cc6d1e95f3
10 changed files with 691 additions and 9 deletions
+21
View File
@@ -0,0 +1,21 @@
'use client';
import { useEffect, useState } from 'react';
/**
* Hook to get the recommendation data source configuration
* @returns The recommendation data source setting (Douban, TMDB, Mixed, MixedSmart)
*/
export function useRecommendationDataSource(): string {
const [dataSource, setDataSource] = useState<string>('Mixed');
useEffect(() => {
// 从运行时配置中读取
if (typeof window !== 'undefined' && window.RUNTIME_CONFIG) {
const configValue = window.RUNTIME_CONFIG.RecommendationDataSource;
setDataSource(configValue || 'Mixed');
}
}, []);
return dataSource;
}