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

Fix: Improved date parsing for Keyoapp sites #7140

Merged
merged 9 commits into from
Jan 13, 2025

Conversation

Nyantad
Copy link
Contributor

@Nyantad Nyantad commented Jan 12, 2025

Introduced DateSelector variable in Keyoapp base class: This allows individual sites to define a custom CSS selector for the date element. The previous fixed selector (.text-xs) failed to accurately capture the date on sites with different HTML structures, for example, it was capturing a "New" tag instead of the actual date.

Updated ReaperScans and StarboundScans to use specific DateSelector values:
These sites required more precise selectors to pinpoint the correct date element within their unique HTML otherwise, it would capture the "New" tag for recently released chapters.

Simplified parseRelativeDate function: Removed the code that sets the time to midnight because it caused incorrect chapter release times. Now, the function correctly calculates the release time by subtracting the relative time from the current time.
If a chapter was released "3 hours ago" and the current time is 4:00 PM, the old code would incorrectly calculate the release time as 9:00 PM the previous day (midnight minus 3 hours). The new code correctly calculates the release time as 1:00 PM today (4:00 PM minus 3 hours).

Checklist:

  • Updated extVersionCode value in build.gradle for individual extensions
  • Updated overrideVersionCode or baseVersionCode as needed for all multisrc extensions
  • Referenced all related issues in the PR body (e.g. "Closes #xyz")
  • Added the isNsfw = true flag in build.gradle when appropriate
  • Have not changed source names
  • Have explicitly kept the id if a source's name or language were changed
  • Have tested the modifications by compiling and running the extension through Android Studio
  • Have removed web_hi_res_512.png when adding a new extension

@Nyantad
Copy link
Contributor Author

Nyantad commented Jan 12, 2025

Also i fixes relative date parsing, adds French support, and corrects Astral Manga date format.

@AwkwardPeak7 AwkwardPeak7 merged commit 2f46fad into keiyoushi:main Jan 13, 2025
2 checks passed
@Nyantad Nyantad deleted the fix/date-parsing branch January 13, 2025 13:02
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants