Skip to content

Add fallback url for kitsu sync#2552

Open
PiterWeb wants to merge 17 commits intorecloudstream:masterfrom
PiterWeb:master
Open

Add fallback url for kitsu sync#2552
PiterWeb wants to merge 17 commits intorecloudstream:masterfrom
PiterWeb:master

Conversation

@PiterWeb
Copy link
Contributor

@PiterWeb PiterWeb commented Mar 6, 2026

As I mentioned in #2527 kitsu.io sometimes is down while kitsu.app is working and are equivalent but kitsu.io is the one that is documented as the api url domain.

So I added a fallback when any of the requests targeting kitsu.io fails it tries with kitsu.app.

This may fix the issue about not syncing anime.

Copy link
Collaborator

@fire-light42 fire-light42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This contains a lot of WET code.
You should use an OkHttp interceptor, or helper function to only write the fallback logic once.

If you need to log errors you should use our built-in function logError(throwable: Throwable).

@PiterWeb
Copy link
Contributor Author

PiterWeb commented Mar 6, 2026

Yeah you are very right, I will investigate on interceptors or create a function like you said to do the code DRY.

If you need to log errors you should use our built-in function logError(throwable: Throwable).

OK, thank you for pointing out.

@PiterWeb
Copy link
Contributor Author

PiterWeb commented Mar 6, 2026

I have moved the fallback logic to an OkHttp injector. Now it looks so much clean :D

@PiterWeb PiterWeb requested a review from fire-light42 March 6, 2026 20:04
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.

2 participants