From 7c1fedaf2ac269c0700a4a82f8216f71d17d31b5 Mon Sep 17 00:00:00 2001 From: mtvpls Date: Sat, 6 Jun 2026 10:08:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=AA=E9=85=8D=E7=BD=AEop?= =?UTF-8?q?ds=E6=BA=90=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=94=B5=E5=AD=90?= =?UTF-8?q?=E4=B9=A6=E9=A6=86=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/layout.tsx | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 2e6d1b4..ba1c791 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -113,12 +113,8 @@ export default async function RootLayout({ let musicFeatureEnabled = false; let suwayomiEnabled = false; let booksEnabled = - process.env.OPDS_ENABLED === 'true' && - !!( - process.env.OPDS_URL || - process.env.NEXT_PUBLIC_OPDS_URL || - process.env.OPDS_SOURCES_JSON - ); + process.env.OPDS_ENABLED === 'true' || + process.env.LEGADO_ENABLED === 'true'; let musicProxyEnabled = true; let advancedRecommendationEnabled = false; let userFeatureAccess = @@ -201,12 +197,9 @@ export default async function RootLayout({ ); // 电子书功能配置 const opdsConfig = config.OPDSConfig; - const rawOpdsSources = opdsConfig?.Sources; - const opdsSources = Array.isArray(rawOpdsSources) ? rawOpdsSources : []; - booksEnabled = !!( - opdsConfig?.Enabled && - opdsSources.some((source) => source?.enabled !== false && !!source?.url) - ); + // 电子书馆同时支持 OPDS 与 Legado。Legado 源通过订阅单独配置, + // 不一定会出现在 OPDS Sources 中;入口应由“启用电子书馆”开关控制。 + booksEnabled = !!opdsConfig?.Enabled; // 高级推荐功能配置:存在已启用视频源脚本时显示 advancedRecommendationEnabled = (await listEnabledSourceScripts()).length > 0;