Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retry method for iTunes API requests #102

Closed
wants to merge 13 commits into from
Closed

Conversation

shiibe
Copy link
Contributor

@shiibe shiibe commented Aug 30, 2024

Hi! It's me again 😅

This PR just adds an enhancement to my last one. This will attempt to hit the iTunes API up to 3 times if it fails before falling back to MusicBrainz for artwork.

I'm still trying to get to the bottom of why the iTunes API will sometimes return "Service Unavailable", but after some tests it does seem to go through on the second attempt each time it happens.

shiibe and others added 12 commits May 1, 2023 15:37
Fixes special characters cutting off the rest of the string
- Added try-catch block in the `main` function to handle connection errors, ensuring the connection is properly closed and attempting reconnection after a delay.
- Implemented a `fetchWithTimeout` function to handle potential delays when fetching data from the iTunes API, improving reliability.
- Updated `_getTrackExtras` to use the new `fetchWithTimeout` for API requests, including error logging on failure.
- Removed timeout from fetch
- Added using MB for a fallback if the iTunes API is unavailable
This adds a method to retry the iTunes API request up to 3 times. For whatever reason, the API will sometimes fail and return a "Service Unavailable" error but will go through on the second attempt.
This reverts commit 6d3bec4.
@shiibe shiibe closed this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant