Skip to content

MangaDex: add created-at filter - #18487

Open
mannedexodus wants to merge 1 commit into
keiyoushi:mainfrom
mannedexodus:mangadex-created-at-filter
Open

MangaDex: add created-at filter#18487
mannedexodus wants to merge 1 commit into
keiyoushi:mainfrom
mannedexodus:mangadex-created-at-filter

Conversation

@mannedexodus

Copy link
Copy Markdown

MangaDex's homepage has a "Popular New Titles" section that can't currently be reproduced in the app. The site fetches it with:

/manga?includes[]=cover_art&includes[]=artist&includes[]=author&order[followedCount]=desc&contentRating[]=safe&contentRating[]=suggestive&hasAvailableChapters=true&createdAtSince=2026-07-18T23:00:00

The extension already supports order[followedCount] (sort by number of follows) and hasAvailableChapters; createdAtSince was the only missing parameter.

Adds a "Created within last" filter exposing it as a preset selection (Any, Day, Week, Month, Year).

The timestamp is floored to the hour so every page in a paginated search sends the same value, rather than recomputing to the current second on each request.

DaysSinceFilter takes the query parameter name as a constructor argument, so sibling parameters such as updatedAtSince can reuse it without further changes.

Tested on Mihon 0.20.4 (Android 16): verified via OkHttp logs that createdAtSince is present and correctly formatted, that it is omitted entirely when "Any" is selected, and that the value stays identical across paginations.

Checklist:

  • Updated versionCode value in build.gradle.kts
  • Updated baseVersionCode in build.gradle.kts (if updated multisrc theme code)
  • Referenced all related issues in the PR body (e.g. "Closes #xyz")
  • Set the contentWarning configuration in build.gradle.kts appropriately
  • 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
  • This PR is AI-assisted, I have reviewed the changes manually and confirmed they are not slop

Comment on lines +239 to +241
val since = Date(
(System.currentTimeMillis() - days * MILLIS_PER_DAY) / MILLIS_PER_HOUR * MILLIS_PER_HOUR,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use java.time or kotlin.time

val dateFormatter = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss+SSS", Locale.US)
.apply { timeZone = TimeZone.getTimeZone("UTC") }

val dateFormatterNoOffset = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use java.time or kotlin.time

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