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

Coffee Manga: use correct chapter pages URL #7444

Merged
merged 2 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ abstract class Madara(
/**
* Get the best image quality available from srcset
*/
private fun String.getSrcSetImage(): String? {
protected fun String.getSrcSetImage(): String? {
return this.split(" ")
.filter(URL_REGEX::matches)
.maxOfOrNull(String::toString)
Expand Down
3 changes: 2 additions & 1 deletion src/en/coffeemanga/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ ext {
extClass = '.CoffeeManga'
themePkg = 'madara'
baseUrl = 'https://coffeemanga.io'
overrideVersionCode = 3
overrideVersionCode = 4
isNsfw = true
}

apply from: "$rootDir/common.gradle"
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
package eu.kanade.tachiyomi.extension.en.coffeemanga

import eu.kanade.tachiyomi.multisrc.madara.Madara
import org.jsoup.nodes.Element

class CoffeeManga : Madara("Coffee Manga", "https://coffeemanga.io", "en") {
override val useNewChapterEndpoint = false

override fun imageFromElement(element: Element): String? {
return when {
element.attr("data-src").isNotBlank() -> element.attr("abs:data-src")
element.attr("data-lazy-src").isNotBlank() -> element.attr("abs:data-lazy-src")
element.attr("srcset").isNotBlank() -> element.attr("abs:srcset").getSrcSetImage()
element.attr("data-cfsrc").isNotBlank() -> element.attr("abs:data-cfsrc")
else -> element.attr("abs:src")
}
}
}