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 Hikka Tracker Integration #1386

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open

Conversation

Lorg0n
Copy link

@Lorg0n Lorg0n commented Oct 26, 2024

Add Hikka tracker integration
Closes #1145

Add support for Hikka (https://hikka.io/), a Ukrainian online encyclopedia for manga and etc.

Changes implemented:

  • Added new Hikka tracker with ID 10
  • Implemented OAuth authentication flow with auto token refresh
  • Added full sync support for:
    • Reading status (Reading, Completed, On Hold, etc.)
    • Chapter progress
    • Scores (0-10 scale)
    • Manga search and linking
  • Created necessary data models and API integration
  • Added UI elements for tracker settings

All changes have been tested:

  • Authentication flow
  • Manga search and linking
  • Status/progress syncing
  • Error handling

Images

Settings Screen Manga Track Dialog
image image

@Smol-Ame
Copy link
Contributor

Include "Closes #1145" in your PR description to link to the feature request issue

@AntsyLich
Copy link
Member

How does the auth flow work for this site?

@Lorg0n
Copy link
Author

Lorg0n commented Oct 26, 2024

How does the auth flow work for this site?

I didn't mean anything special, just standard OAuth authorization.

@AntsyLich
Copy link
Member

Ok I was ambiguous. How does one create a oauth client or get the reference?

@Lorg0n
Copy link
Author

Lorg0n commented Oct 26, 2024

Ok I was ambiguous. How does one create a oauth client or get the reference?

https://hikka.io/settings/applications

@AntsyLich
Copy link
Member

Trying to create a new client I'm getting the error "Invalid field endpoint in request body"

@AntsyLich
Copy link
Member

Ok so the issue is with using the custom redirect url

@AntsyLich
Copy link
Member

Blocked by hikka-io/hikka#347

@Lorg0n
Copy link
Author

Lorg0n commented Oct 27, 2024

I'll redo the authorisation to work after the changes then

@Lorg0n
Copy link
Author

Lorg0n commented Oct 27, 2024

Okay, I changed the authorization. My local tests went fine
image

@Lorg0n
Copy link
Author

Lorg0n commented Oct 27, 2024

I don't understand why the test fails, even though everything is fine in my fork. I didn't touch MangaScreenModel.kt at all

@AntsyLich
Copy link
Member

AntsyLich commented Oct 27, 2024

Yeah ignore that bit. It passed lint previously but suddenly started to flag from today.

@AntsyLich
Copy link
Member

Rebase please

Copy link
Member

@MajorTanya MajorTanya left a comment

Choose a reason for hiding this comment

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

These are some code things I found, going to play around with the actual integration for a bit now.

@MajorTanya
Copy link
Member

I just saw that Hikka merged support for start and end dates for manga. If you could add that once it's running in production it would be really cool. If I understand their code correctly, this is about starting and ending dates for the title itself, not the user's starting and ending dates of reading, so this would be used in the search like other trackers do.

@Lorg0n
Copy link
Author

Lorg0n commented Feb 26, 2025

Unfortunately this update only applies to a request for information about a specific manga and does not give that data in a search query

@AntsyLich
Copy link
Member

Merge in the latest change from main

Copy link
Member

@MajorTanya MajorTanya left a comment

Choose a reason for hiding this comment

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

Can't find anything breaking or broken, and the code appears to be nice too. Thanks for the good work.

@@ -168,6 +169,12 @@ object SettingsTrackingScreen : SearchableSettings {
login = { context.openInBrowser(BangumiApi.authUrl(), forceDefaultBrowser = true) },
logout = { dialog = LogoutDialog(trackerManager.bangumi) },
),
Preference.PreferenceItem.TrackerPreference(
title = trackerManager.hikka.name,
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't compile. Remove the title line and it should be good.

Copy link
Member

Choose a reason for hiding this comment

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

And in case you're worried, it still shows Hikka in the Tracking screen.

Copy link
Author

Choose a reason for hiding this comment

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

And in case you're worried, it still shows Hikka in the Tracking screen.

Yes, thanks, the problem appeared because I wrote back when all trackers had a title. Fixed it now

@MajorTanya
Copy link
Member

Somehow messed up with hiding the comment, it is not outdated. Please take a look at the requested change.

Copy link
Member

@MajorTanya MajorTanya left a comment

Choose a reason for hiding this comment

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

I think this time for real I can't find anything broken. It appeared to work once the change in b347453 was applied. Didn't do super in-depth edge case testing but cursory adding, moving, scoring, etc all seemed to work. 👍

@AntsyLich
Copy link
Member

Run ./gradlew spotlessApply

@AntsyLich
Copy link
Member

The PR as is fine but I'll delay merging this until a small DB rework so we won't require workarounds like this
image

Estimating a week at max

@Lorg0n
Copy link
Author

Lorg0n commented Feb 27, 2025

I'll ask the Hikka developers about a unique number(id) for the manga, I think I'll solve the problem

@AntsyLich
Copy link
Member

In case you misunderstood this is something I intent to fix Mihon side since more tracker we add in the future may not have numeric ID

@Lorg0n
Copy link
Author

Lorg0n commented Feb 27, 2025

Okay, I got it

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.

hikka.io tracker support
4 participants