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

Read Mangas: Fix description #7249

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hellkaros
Copy link
Contributor

Closes #7248

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

thumbnail_url = document.selectFirst("img.w-full")?.absUrl("src")

genre = document.select("div > label + div > div").joinToString { it.text() }

description = document.select("script").map { it.data() }
.firstOrNull { MANGA_DETAILS_DESCRIPTION_REGEX.containsMatchIn(it) }
Copy link
Contributor

Choose a reason for hiding this comment

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

you don't need this regex to just check if it contains description

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, it does need to, because there are multiple script elements inside the document, and we need to find the one that contains the description within.

Copy link
Contributor

@choppeh choppeh Jan 20, 2025

Choose a reason for hiding this comment

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

Actually, it does need to, because there are multiple script elements inside the document, and we need to find the one that contains the description within.

You can use

.firstOrNull { it.contains("description\":\"", ignoreCase = true) }

or

.firstOrNull { it.contains("description", ignoreCase = true) }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, it does need to, because there are multiple script elements inside the document, and we need to find the one that contains the description within.

You can use

.firstOrNull { it.contains("description\":\"", ignoreCase = true) }

or

.firstOrNull { it.contains("description", ignoreCase = true) }

I'll test it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@choppeh It worked, ty. Fix 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.

Read Mangas: Fix Description
3 participants