mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-02-28 01:13:15 +08:00
feat: disable infinite retry when load error
This commit is contained in:
@@ -104,8 +104,6 @@ function LivePageClient() {
|
|||||||
const cleanEpgData = (programs: Array<{ start: string; end: string; title: string }>) => {
|
const cleanEpgData = (programs: Array<{ start: string; end: string; title: string }>) => {
|
||||||
if (!programs || programs.length === 0) return programs;
|
if (!programs || programs.length === 0) return programs;
|
||||||
|
|
||||||
console.log(`开始清洗EPG数据,原始节目数量: ${programs.length}`);
|
|
||||||
|
|
||||||
// 获取今日日期(只考虑年月日,忽略时间)
|
// 获取今日日期(只考虑年月日,忽略时间)
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const todayStart = new Date(today.getFullYear(), today.getMonth(), today.getDate());
|
const todayStart = new Date(today.getFullYear(), today.getMonth(), today.getDate());
|
||||||
@@ -128,8 +126,6 @@ function LivePageClient() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`过滤今日节目后数量: ${todayPrograms.length}`);
|
|
||||||
|
|
||||||
// 按开始时间排序
|
// 按开始时间排序
|
||||||
const sortedPrograms = [...todayPrograms].sort((a, b) => {
|
const sortedPrograms = [...todayPrograms].sort((a, b) => {
|
||||||
const startA = parseCustomTimeFormat(a.start).getTime();
|
const startA = parseCustomTimeFormat(a.start).getTime();
|
||||||
@@ -186,10 +182,8 @@ function LivePageClient() {
|
|||||||
|
|
||||||
// 如果当前节目时间更短,则替换已存在的节目
|
// 如果当前节目时间更短,则替换已存在的节目
|
||||||
if (currentDuration < existingDuration) {
|
if (currentDuration < existingDuration) {
|
||||||
console.log(`替换重叠节目: "${existingProgram.title}" (${existingDuration}ms) -> "${currentProgram.title}" (${currentDuration}ms)`);
|
|
||||||
cleanedPrograms[j] = currentProgram;
|
cleanedPrograms[j] = currentProgram;
|
||||||
} else {
|
} else {
|
||||||
console.log(`跳过重叠节目: "${currentProgram.title}" (${currentDuration}ms),保留 "${existingProgram.title}" (${existingDuration}ms)`);
|
|
||||||
removedCount++;
|
removedCount++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -198,7 +192,6 @@ function LivePageClient() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`EPG数据清洗完成,清洗后节目数量: ${cleanedPrograms.length},移除重叠节目: ${removedCount}个,过滤非今日节目: ${dateFilteredCount}个`);
|
|
||||||
return cleanedPrograms;
|
return cleanedPrograms;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -604,7 +597,7 @@ function LivePageClient() {
|
|||||||
hls.startLoad();
|
hls.startLoad();
|
||||||
break;
|
break;
|
||||||
case Hls.ErrorTypes.MEDIA_ERROR:
|
case Hls.ErrorTypes.MEDIA_ERROR:
|
||||||
hls.recoverMediaError();
|
// hls.recoverMediaError();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
hls.destroy();
|
hls.destroy();
|
||||||
|
|||||||
Reference in New Issue
Block a user