豁免小雅优选和测速

This commit is contained in:
mtvpls
2026-01-11 20:10:12 +08:00
parent 8b74ddc73f
commit 8c2db37d45
3 changed files with 27 additions and 17 deletions

View File

@@ -271,16 +271,18 @@ const EpisodeSelector: React.FC<EpisodeSelectorProps> = ({
if (
!optimizationEnabled || // 若关闭测速则直接退出
activeTab !== 'sources' ||
availableSources.length === 0 ||
currentSource === 'openlist' || // 私人影库不进行测速
currentSource === 'emby' // Emby 不进行测速
availableSources.length === 0
)
return;
// 筛选出尚未测速的播放源
// 筛选出尚未测速的播放源并排除不需要测速的源openlist/emby/xiaoya
const pendingSources = availableSources.filter((source) => {
const sourceKey = `${source.source}-${source.id}`;
return !attemptedSourcesRef.current.has(sourceKey);
// 跳过已测速的源
if (attemptedSourcesRef.current.has(sourceKey)) return false;
// 跳过不需要测速的源
if (source.source === 'openlist' || source.source === 'emby' || source.source.startsWith('emby_') || source.source === 'xiaoya') return false;
return true;
});
if (pendingSources.length === 0) return;
@@ -308,11 +310,15 @@ const EpisodeSelector: React.FC<EpisodeSelectorProps> = ({
// 当后台加载从 true 变为 false 时(即加载完成)
if (prevBackgroundLoadingRef.current && !backgroundSourcesLoading) {
// 如果当前选项卡在换源位置,触发测速
if (activeTab === 'sources' && optimizationEnabled && currentSource !== 'openlist' && currentSource !== 'emby') {
// 筛选出尚未测速的播放源
if (activeTab === 'sources' && optimizationEnabled) {
// 筛选出尚未测速的播放源并排除不需要测速的源openlist/emby/xiaoya
const pendingSources = availableSources.filter((source) => {
const sourceKey = `${source.source}-${source.id}`;
return !attemptedSourcesRef.current.has(sourceKey);
// 跳过已测速的源
if (attemptedSourcesRef.current.has(sourceKey)) return false;
// 跳过不需要测速的源
if (source.source === 'openlist' || source.source === 'emby' || source.source.startsWith('emby_') || source.source === 'xiaoya') return false;
return true;
});
if (pendingSources.length > 0) {
@@ -907,8 +913,8 @@ const EpisodeSelector: React.FC<EpisodeSelectorProps> = ({
</div>
{/* 重新测试按钮 */}
{(() => {
// 私人影库Emby 不显示重新测试按钮
if (source.source === 'openlist' || source.source === 'emby' || source.source.startsWith('emby_')) {
// 私人影库Emby 和小雅不显示重新测试按钮
if (source.source === 'openlist' || source.source === 'emby' || source.source.startsWith('emby_') || source.source === 'xiaoya') {
return null;
}