mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-15 13:46:16 -08:00
fix(playback): support current web build target
This commit is contained in:
1 parent
9e6c67ff48
commit
13b1cfe57e
1 file changed
+12
-4
@@ -102,10 +102,7 @@ function revealCappedExternalSiblings(
|
||||
continue;
|
||||
}
|
||||
if (retained.length >= 3) {
|
||||
const replaceIndex = retained.findLastIndex(
|
||||
(recommendation, index) =>
|
||||
index > 0 && !isExternalRecommendation(recommendation)
|
||||
);
|
||||
const replaceIndex = findLastReplaceableRecommendation(retained);
|
||||
if (replaceIndex < 0) {
|
||||
continue;
|
||||
}
|
||||
@@ -116,6 +113,17 @@ function revealCappedExternalSiblings(
|
||||
return retained;
|
||||
}
|
||||
|
||||
function findLastReplaceableRecommendation(
|
||||
recommendations: readonly PlaybackRecommendation[]
|
||||
): number {
|
||||
for (let index = recommendations.length - 1; index > 0; index -= 1) {
|
||||
if (!isExternalRecommendation(recommendations[index])) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
function rerankExternalRecommendations(
|
||||
recommendations: readonly PlaybackRecommendation[],
|
||||
states: ExternalRecoveryStates
|
||||
|
||||
Reference in new issue
Block a user