aymene69 / stremio-jackett

Elevate your Stremio experience with seamless access to Jackett torrent links, effortlessly fetching torrents for your selected movies within the Stremio interface.
189 stars 35 forks source link

[Bug] wait() when fetching and retrying for RD links does not actually wait #72

Closed matukaa closed 7 months ago

matukaa commented 7 months ago

Describe the bug await wait(5000) does not actually do anything in any of the getMovieProviderLink files, it will retry per frame instead of waiting 5 seconds between tries.

To Reproduce Try to open any result fetched from Jackett which is not yet cached by RD (in my case).

Expected behavior Wait the expected amount of time between retries.

Screenshots image

Your system info (please complete the following information):

Additional context wait() creates a Promise but it does not return it, so the await does not receive any Promise to actually await for. It just instantly steps over and repeats the loops.

Suggested solution Return the created promise:

function wait(ms) {
    new Promise(resolve => setTimeout(resolve, ms));
}
aymene69 commented 7 months ago

Fixed