gmertes / NflxMultiSubs

Bilingual Subtitles for the Netflix Web App. An actively maintained fork with various bugfixes and improvements to the original NflxMultiSubs.
MIT License
166 stars 23 forks source link

Replace Promise.race with Promise.any #48

Closed fifv closed 6 months ago

fifv commented 6 months ago

Secondary subtitles often loading forever on my machine. This is because I have poor network connections, some requests got rejected by Netflix.

Currently NflxMultiSubs use Promise.race to choose the first settled url, but a fetch may be rejected with e.g. SSL error, and it will also be settled, which is actually unusable.

Instead, Promise.any will use first fulfilled fetch, so only resolved ones are considered.

I have modified this locally and watch some episodes, seems works well :) . The image shows that after modified, even 2/3 urls were rejected, this extension chose the rest one url and fetched successfully.

image