Actually remove rejected promises from the pendingList

otherwise this may cause a failure to be "cached" and never removed,
resulting in the inability to refresh segments until the page is
refreshed
This commit is contained in:
mini-bomba
2025-08-19 20:12:42 +02:00
parent 06ead877b4
commit 9d48d4e0fe

View File

@@ -37,8 +37,12 @@ export async function getSegmentsForVideo(videoID: VideoID, ignoreCache: boolean
const pendingData = fetchSegmentsForVideo(videoID);
pendingList[videoID] = pendingData;
const result = await pendingData;
delete pendingList[videoID];
let result: Awaited<typeof pendingData>;
try {
result = await pendingData;
} finally {
delete pendingList[videoID];
}
return result;
}