Skip to content

Conversation

@PiterWeb
Copy link
Contributor

This pull request is trying to resolve the issue #2031.
In the issue I posted screenshots on what it looks like implemented

Implemented functionality:

  • User login with kitsu credentials
  • Kitsu library
  • Update anime sync in left-side sync panel

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.

Very good code, I will leave a more detailed review after I have tested it.


override suspend fun load(auth : AuthData?, id: String): SyncResult? {
val auth = auth?.token?.accessToken ?: return null
id.toIntOrNull() ?: return null
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you mean to write val id = id.toIntOrNull() ?: return null because this is confusing to read even if its only purpose is to return null on non-int ids.

Copy link
Contributor Author

@PiterWeb PiterWeb Jan 22, 2026

Choose a reason for hiding this comment

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

I write it like that to return null if the id failed on converting to int. Now that I look at it, it is confusing hahaha. I can change it to

if (id.toIntOrNull() == null) {
 return null
}

or not doing the comprobation. In fact I think this is the best option because Kitsu uses numbers inside a string so in a future they might introduce other strings that are not numeric values

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, do that as it becomes clear what exactly you are trying to do. Otherwise one might think that you can refactor the code by removing your current statement.

val fullList = mutableListOf<KitsuNode>()
val listMutex = Mutex(false)

coroutineScope {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why? From the looks of it a simple while loop should work fine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, right now it can be a normal loop, the initial reason of that was because I misunderstood the way the Kitsu api worked and to achieve a decent result in time I need a lot of concurrency.

I will modify to use a simple loop

this.addSimklId(SimklSyncServices.Mal, id.toString())
}

fun LoadResponse.addKitsuId(id: Int?) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a prerelease annotation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean a comment in top saying "Prerelease" ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, we use the annotation @Prerelease

@PiterWeb
Copy link
Contributor Author

In the way of doing the changes requested I have also corrected the updateStatus functionality when None is selected in the status to delete that anime from the library

@PiterWeb PiterWeb requested a review from fire-light42 January 22, 2026 18:18
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