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
Describe the bugawait 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
Your system info (please complete the following information):
OS: Windows
Docker or Node - both
Additional contextwait() 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));
}
Describe the bug
await wait(5000)
does not actually do anything in any of thegetMovieProviderLink
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](https://github.com/aymene69/stremio-jackett/assets/7106864/72997b43-1227-4cf0-992f-01ba4b82346e)
Your system info (please complete the following information):
Additional context
wait()
creates aPromise
but it does not return it, so theawait
does not receive anyPromise
to actually await for. It just instantly steps over and repeats the loops.Suggested solution Return the created promise: