merge main
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
## [206.2.1] - 2026-01-08
|
||||
### Fixed
|
||||
- 修正豆瓣图片源
|
||||
|
||||
## [206.2.0] - 2026-01-07
|
||||
### Added
|
||||
- 轮播图数据源增加豆瓣
|
||||
|
||||
@@ -1 +1 @@
|
||||
206.2.0
|
||||
206.2.1
|
||||
@@ -175,13 +175,17 @@ export async function GET(request: NextRequest) {
|
||||
]);
|
||||
|
||||
// 分离结果:第一个是 openlist,接下来是 emby 结果,最后是 api 结果
|
||||
const openlistResults = allResults[0];
|
||||
// 添加安全检查,确保即使某个结果处理出错也不影响其他结果
|
||||
const openlistResults = Array.isArray(allResults[0]) ? allResults[0] : [];
|
||||
const embyResultsArray = allResults.slice(1, 1 + embyPromises.length);
|
||||
const apiResults = allResults.slice(1 + embyPromises.length);
|
||||
|
||||
// 合并所有 Emby 结果
|
||||
const embyResults = embyResultsArray.flat();
|
||||
let flattenedResults = [...openlistResults, ...embyResults, ...apiResults.flat()];
|
||||
// 合并所有 Emby 结果,添加安全检查
|
||||
const embyResults = embyResultsArray.filter(Array.isArray).flat();
|
||||
const apiResultsFlat = apiResults.filter(Array.isArray).flat();
|
||||
|
||||
let flattenedResults = [...openlistResults, ...embyResults, ...apiResultsFlat];
|
||||
|
||||
if (!config.SiteConfig.DisableYellowFilter) {
|
||||
flattenedResults = flattenedResults.filter((result) => {
|
||||
const typeName = result.type_name || '';
|
||||
@@ -207,6 +211,7 @@ export async function GET(request: NextRequest) {
|
||||
}
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('[Search] 搜索结果处理失败:', error);
|
||||
return NextResponse.json({ error: '搜索失败' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,9 @@ export async function GET(request: NextRequest) {
|
||||
const sourceValue = embySources.length === 1 ? 'emby' : `emby_${embyConfig.key}`;
|
||||
const sourceName = embySources.length === 1 ? 'Emby' : embyConfig.name;
|
||||
|
||||
const results = searchResult.Items.map((item) => ({
|
||||
// 添加安全检查,确保 Items 存在且是数组
|
||||
const items = Array.isArray(searchResult?.Items) ? searchResult.Items : [];
|
||||
const results = items.map((item) => ({
|
||||
id: item.Id,
|
||||
source: sourceValue,
|
||||
source_name: sourceName,
|
||||
@@ -258,19 +260,21 @@ export async function GET(request: NextRequest) {
|
||||
.then((openlistResults: any) => {
|
||||
completedSources++;
|
||||
if (!streamClosed) {
|
||||
// 添加安全检查,确保结果是数组
|
||||
const safeResults = Array.isArray(openlistResults) ? openlistResults : [];
|
||||
const sourceEvent = `data: ${JSON.stringify({
|
||||
type: 'source_result',
|
||||
source: 'openlist',
|
||||
sourceName: '私人影库',
|
||||
results: openlistResults,
|
||||
results: safeResults,
|
||||
timestamp: Date.now()
|
||||
})}\n\n`;
|
||||
if (!safeEnqueue(encoder.encode(sourceEvent))) {
|
||||
streamClosed = true;
|
||||
return;
|
||||
}
|
||||
if (openlistResults.length > 0) {
|
||||
allResults.push(...openlistResults);
|
||||
if (safeResults.length > 0) {
|
||||
allResults.push(...safeResults);
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -303,10 +307,13 @@ export async function GET(request: NextRequest) {
|
||||
|
||||
const results = await searchPromise as any[];
|
||||
|
||||
// 添加安全检查,确保结果是数组
|
||||
const safeResults = Array.isArray(results) ? results : [];
|
||||
|
||||
// 过滤黄色内容
|
||||
let filteredResults = results;
|
||||
let filteredResults = safeResults;
|
||||
if (!config.SiteConfig.DisableYellowFilter) {
|
||||
filteredResults = results.filter((result) => {
|
||||
filteredResults = safeResults.filter((result) => {
|
||||
const typeName = result.type_name || '';
|
||||
return !yellowWords.some((word: string) => typeName.includes(word));
|
||||
});
|
||||
|
||||
@@ -11,6 +11,18 @@ export interface ChangelogEntry {
|
||||
|
||||
export const changelog: ChangelogEntry[] = [
|
||||
{
|
||||
version: '206.2.1',
|
||||
date: '2026-01-08',
|
||||
added: [
|
||||
|
||||
],
|
||||
changed: [
|
||||
|
||||
],
|
||||
fixed: [
|
||||
"修正豆瓣图片源"
|
||||
]
|
||||
},{
|
||||
version: '206.2.0',
|
||||
date: '2026-01-07',
|
||||
added: [
|
||||
|
||||
@@ -50,50 +50,27 @@ export function processImageUrl(originalUrl: string): string {
|
||||
return originalUrl;
|
||||
}
|
||||
|
||||
// 获取用户配置的代理设置
|
||||
const { proxyType, proxyUrl } = getDoubanImageProxyConfig();
|
||||
|
||||
// 根据代理类型处理URL
|
||||
switch (proxyType) {
|
||||
case 'direct':
|
||||
// 直连,不使用代理
|
||||
return originalUrl;
|
||||
|
||||
case 'server':
|
||||
// 使用服务器代理
|
||||
return `/api/image-proxy?url=${encodeURIComponent(originalUrl)}`;
|
||||
|
||||
case 'img3':
|
||||
// 使用 img3.doubanio.com 代理
|
||||
return originalUrl.replace(/img\d\.doubanio\.com/g, 'img3.doubanio.com');
|
||||
|
||||
return originalUrl.replace(/img\d+\.doubanio\.com/g, 'img3.doubanio.com');
|
||||
case 'cmliussss-cdn-tencent':
|
||||
// 使用腾讯云CDN代理
|
||||
return originalUrl.replace(
|
||||
/https?:\/\/img\d\.doubanio\.com/g,
|
||||
'https://douban-img.cmliussss.workers.dev'
|
||||
/img\d+\.doubanio\.com/g,
|
||||
'img.doubanio.cmliussss.net'
|
||||
);
|
||||
|
||||
case 'cmliussss-cdn-ali':
|
||||
// 使用阿里云CDN代理
|
||||
return originalUrl.replace(
|
||||
/https?:\/\/img\d\.doubanio\.com/g,
|
||||
'https://douban-img-ali.cmliussss.workers.dev'
|
||||
/img\d+\.doubanio\.com/g,
|
||||
'img.doubanio.cmliussss.com'
|
||||
);
|
||||
|
||||
case 'custom':
|
||||
// 使用自定义代理
|
||||
if (proxyUrl) {
|
||||
return originalUrl.replace(/https?:\/\/img\d\.doubanio\.com/g, proxyUrl);
|
||||
}
|
||||
return originalUrl;
|
||||
|
||||
return `${proxyUrl}${encodeURIComponent(originalUrl)}`;
|
||||
case 'direct':
|
||||
default:
|
||||
// 默认使用腾讯云CDN代理
|
||||
return originalUrl.replace(
|
||||
/https?:\/\/img\d\.doubanio\.com/g,
|
||||
'https://douban-img.cmliussss.workers.dev'
|
||||
);
|
||||
return originalUrl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable no-console */
|
||||
|
||||
const CURRENT_VERSION = '206.2.0';
|
||||
const CURRENT_VERSION = '206.2.1';
|
||||
|
||||
// 导出当前版本号供其他地方使用
|
||||
export { CURRENT_VERSION };
|
||||
|
||||
Reference in New Issue
Block a user