增加只搜私人影库
This commit is contained in:
@@ -26,6 +26,7 @@ export async function GET(request: NextRequest) {
|
||||
const { searchParams } = new URL(request.url);
|
||||
const query = searchParams.get('q');
|
||||
const includeSpecialSources = searchParams.get('special') === '1';
|
||||
const privateOnly = searchParams.get('privateOnly') === '1';
|
||||
|
||||
if (!query) {
|
||||
const cacheTime = await getCacheTime();
|
||||
@@ -43,7 +44,9 @@ export async function GET(request: NextRequest) {
|
||||
}
|
||||
|
||||
const config = await getConfig();
|
||||
const apiSites = await getAvailableApiSites(authInfo.username, includeSpecialSources);
|
||||
const apiSites = privateOnly
|
||||
? []
|
||||
: await getAvailableApiSites(authInfo.username, includeSpecialSources);
|
||||
const [canAccessOpenList, canAccessEmby] = await Promise.all([
|
||||
hasFeaturePermission(authInfo.username, 'private_library'),
|
||||
hasFeaturePermission(authInfo.username, 'emby'),
|
||||
@@ -191,7 +194,7 @@ export async function GET(request: NextRequest) {
|
||||
})
|
||||
);
|
||||
|
||||
const scriptSummaries = await listEnabledSourceScripts();
|
||||
const scriptSummaries = privateOnly ? [] : await listEnabledSourceScripts();
|
||||
const scriptPromises = scriptSummaries.map((script) =>
|
||||
Promise.race([
|
||||
(async () => {
|
||||
|
||||
Reference in New Issue
Block a user