diff --git a/.github/summary.yaml b/.github/summary.yaml index 268c221f..28eb6578 100644 --- a/.github/summary.yaml +++ b/.github/summary.yaml @@ -1 +1 @@ -total: 1190 +total: 1190 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 56a91252..d2d606cd 100644 --- a/.gitignore +++ b/.gitignore @@ -83,3 +83,4 @@ bin/ src/test/resources/cookies.txt local.properties .kotlin/ +!/.idea/kotlin-statistics.xml diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/model/Manga.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/model/Manga.kt index d7a9b8dd..ec834042 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/model/Manga.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/model/Manga.kt @@ -4,8 +4,7 @@ import androidx.collection.ArrayMap import org.koitharu.kotatsu.parsers.util.findById import org.koitharu.kotatsu.parsers.util.nullIfEmpty -@ExposedCopyVisibility -public data class Manga private constructor( +public data class Manga constructor( /** * Unique identifier for manga */ @@ -72,6 +71,41 @@ public data class Manga private constructor( @JvmField public val source: MangaSource, ) { + @Deprecated("Prefer constructor with contentRating instead of isNsfw") + public constructor( + id: Long, + title: String, + altTitle: String?, + url: String, + publicUrl: String, + rating: Float, + isNsfw: Boolean, + coverUrl: String?, + tags: Set, + state: MangaState?, + author: String?, + largeCoverUrl: String? = null, + description: String? = null, + chapters: List? = null, + source: MangaSource, + ) : this( + id = id, + title = title, + altTitle = altTitle?.nullIfEmpty(), + url = url, + publicUrl = publicUrl, + rating = rating, + contentRating = if (isNsfw) ContentRating.ADULT else null, + coverUrl = coverUrl?.nullIfEmpty(), + tags = tags, + state = state, + author = author?.nullIfEmpty(), + largeCoverUrl = largeCoverUrl?.nullIfEmpty(), + description = description?.nullIfEmpty(), + chapters = chapters, + source = source, + ) + /** * Return if manga has a specified rating * @see rating @@ -102,174 +136,4 @@ public data class Manga private constructor( } return result } - - public companion object { - - @Deprecated("") - public operator fun invoke( - /** - * Unique identifier for manga - */ - id: Long, - /** - * Manga title, human-readable - */ - title: String, - /** - * Alternative title (for example on other language), may be null - */ - altTitle: String?, - /** - * Relative url to manga (**without** a domain) or any other uri. - * Used principally in parsers - */ - url: String, - /** - * Absolute url to manga, must be ready to open in browser - */ - publicUrl: String, - /** - * Normalized manga rating, must be in range of 0..1 or [RATING_UNKNOWN] if rating s unknown - * @see hasRating - */ - rating: Float, - /** - * Indicates that manga may contain sensitive information (18+, NSFW) - */ - isNsfw: Boolean, - /** - * Absolute link to the cover - * @see largeCoverUrl - */ - coverUrl: String?, - /** - * Tags (genres) of the manga - */ - tags: Set, - /** - * Manga status (ongoing, finished) or null if unknown - */ - state: MangaState?, - /** - * Author of the manga, may be null - */ - author: String?, - /** - * Large cover url (absolute), null if is no large cover - * @see coverUrl - */ - largeCoverUrl: String? = null, - /** - * Manga description, may be html or null - */ - description: String? = null, - /** - * List of chapters - */ - chapters: List? = null, - /** - * Manga source - */ - source: MangaSource, - ): Manga = invoke( - id = id, - title = title, - altTitle = altTitle, - url = url, - publicUrl = publicUrl, - rating = rating, - contentRating = if (isNsfw) ContentRating.ADULT else ContentRating.SAFE, - coverUrl = coverUrl, - tags = tags, - state = state, - author = author, - largeCoverUrl = largeCoverUrl, - description = description, - chapters = chapters, - source = source, - ) - - public operator fun invoke( - /** - * Unique identifier for manga - */ - id: Long, - /** - * Manga title, human-readable - */ - title: String, - /** - * Alternative title (for example on other language), may be null - */ - altTitle: String?, - /** - * Relative url to manga (**without** a domain) or any other uri. - * Used principally in parsers - */ - url: String, - /** - * Absolute url to manga, must be ready to open in browser - */ - publicUrl: String, - /** - * Normalized manga rating, must be in range of 0..1 or [RATING_UNKNOWN] if rating s unknown - * @see hasRating - */ - rating: Float, - /** - * Indicates that manga may contain sensitive information (18+, NSFW) - */ - contentRating: ContentRating?, - /** - * Absolute link to the cover - * @see largeCoverUrl - */ - coverUrl: String?, - /** - * Tags (genres) of the manga - */ - tags: Set, - /** - * Manga status (ongoing, finished) or null if unknown - */ - state: MangaState?, - /** - * Author of the manga, may be null - */ - author: String?, - /** - * Large cover url (absolute), null if is no large cover - * @see coverUrl - */ - largeCoverUrl: String? = null, - /** - * Manga description, may be html or null - */ - description: String? = null, - /** - * List of chapters - */ - chapters: List? = null, - /** - * Manga source - */ - source: MangaSource, - ): Manga = Manga( - id = id, - title = title, - altTitle = altTitle?.nullIfEmpty(), - url = url, - publicUrl = publicUrl, - rating = rating, - contentRating = contentRating, - coverUrl = coverUrl?.nullIfEmpty(), - tags = tags, - state = state, - author = author?.nullIfEmpty(), - largeCoverUrl = largeCoverUrl?.nullIfEmpty(), - description = description?.nullIfEmpty(), - chapters = chapters, - source = source, - ) - } } diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/BatoToParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/BatoToParser.kt index 1257ccc0..555757f5 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/BatoToParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/BatoToParser.kt @@ -116,7 +116,7 @@ internal class BatoToParser(context: MangaLoaderContext) : PagedMangaParser( "zbato.net", "zbato.org", "fto.to", - "jto.to" + "jto.to", ) override suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List { @@ -338,7 +338,7 @@ internal class BatoToParser(context: MangaLoaderContext) : PagedMangaParser( publicUrl = a.absUrl("href"), rating = RATING_UNKNOWN, isNsfw = false, - coverUrl = div.selectFirst("img[src]")?.absUrl("src").orEmpty(), + coverUrl = div.selectFirst("img[src]")?.absUrl("src"), largeCoverUrl = null, description = null, tags = div.selectFirst(".item-genre")?.parseTags().orEmpty(), diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ComickFunParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ComickFunParser.kt index 22f0041c..71be24b2 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ComickFunParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ComickFunParser.kt @@ -156,8 +156,8 @@ internal class ComickFunParser(context: MangaLoaderContext) : url = slug, publicUrl = "https://$domain/comic/$slug", rating = jo.getDoubleOrDefault("rating", -10.0).toFloat() / 10f, - isNsfw = false, - coverUrl = jo.getString("cover_url"), + contentRating = null, + coverUrl = jo.getStringOrNull("cover_url"), largeCoverUrl = null, description = jo.getStringOrNull("desc"), tags = jo.selectGenres(tagsMap), @@ -179,10 +179,11 @@ internal class ComickFunParser(context: MangaLoaderContext) : val url = "https://api.$domain/comic/${manga.url}?tachiyomi=true" val jo = webClient.httpGet(url).parseJson() val comic = jo.getJSONObject("comic") - var alt = "" - comic.getJSONArray("md_titles").mapJSON { alt += it.getString("title") + " - " } + val alt = comic.getJSONArray("md_titles").asTypedList().joinToString("\n") { + it.getStringOrNull("title").orEmpty() + } return manga.copy( - altTitle = alt.ifEmpty { comic.getStringOrNull("title") }?.nullIfEmpty(), + altTitle = alt.nullIfEmpty(), contentRating = if (jo.getBooleanOrDefault("matureContent", false) || comic.getBooleanOrDefault("hentai", false) ) { diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ExHentaiParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ExHentaiParser.kt index 3cdfe301..4d007e6d 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ExHentaiParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ExHentaiParser.kt @@ -167,9 +167,10 @@ internal class ExHentaiParser( val a = gLink.parents().select("a").first() ?: gLink.parseFailed("link not found") val href = a.attrAsRelativeUrl("href") val tagsDiv = gLink.nextElementSibling() ?: gLink.parseFailed("tags div not found") + val rawTitle = gLink.text() Manga( id = generateUid(href), - title = gLink.text().cleanupTitle(), + title = rawTitle.cleanupTitle(), altTitle = null, url = href, publicUrl = a.absUrl("href"), @@ -177,9 +178,12 @@ internal class ExHentaiParser( contentRating = ContentRating.ADULT, coverUrl = td1.selectFirst("img")?.attrAsAbsoluteUrlOrNull("src"), tags = tagsDiv.parseTags(), - state = null, + state = when { + rawTitle.contains("(ongoing)", ignoreCase = true) -> MangaState.ONGOING + else -> null + }, author = tagsDiv.getElementsContainingOwnText("artist:").first() - ?.nextElementSibling()?.text(), + ?.nextElementSibling()?.textOrNull(), source = source, ) } diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ImHentai.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ImHentai.kt index fbdb9dc7..8622c996 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ImHentai.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/ImHentai.kt @@ -120,7 +120,7 @@ internal class ImHentai(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(domain), - coverUrl = a.selectFirst("img")?.src().orEmpty(), + coverUrl = a.selectFirst("img")?.src(), title = div.selectFirst(".caption")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, @@ -197,7 +197,7 @@ internal class ImHentai(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(domain), - coverUrl = a.selectFirst("img")?.src().orEmpty(), + coverUrl = a.selectFirst("img")?.src(), title = div.selectFirst(".caption")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaDexParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaDexParser.kt index 9f57ba58..002f1a58 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaDexParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaDexParser.kt @@ -302,7 +302,7 @@ internal class MangaDexParser(context: MangaLoaderContext) : MangaParser(context "safe" -> ContentRating.SAFE else -> null }, - coverUrl = cover?.plus(".256.jpg").orEmpty(), + coverUrl = cover?.plus(".256.jpg"), largeCoverUrl = cover, description = attrs.optJSONObject("description")?.selectByLocale(), tags = attrs.getJSONArray("tags").mapJSONToSet { tag -> @@ -338,7 +338,7 @@ internal class MangaDexParser(context: MangaLoaderContext) : MangaParser(context getStringOrNull(locale.language)?.let { return it } getStringOrNull(locale.toLanguageTag())?.let { return it } } - return getStringOrNull(LOCALE_FALLBACK) ?: entries().firstOrNull()?.value + return getStringOrNull(LOCALE_FALLBACK) ?: entries().firstOrNull()?.value?.nullIfEmpty() } private fun JSONArray.flatten(): JSONObject { diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaPark.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaPark.kt index a51c78cb..c23bff75 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaPark.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaPark.kt @@ -31,7 +31,7 @@ internal class MangaPark(context: MangaLoaderContext) : "parkmanga.com", "parkmanga.net", "parkmanga.org", - "mpark.to" + "mpark.to", ) override fun onCreateConfig(keys: MutableCollection>) { @@ -155,7 +155,7 @@ internal class MangaPark(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirst("h3")?.text().orEmpty(), altTitle = null, rating = div.selectFirst("span.text-yellow-500")?.text()?.toFloatOrNull()?.div(10F) ?: RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaReaderToParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaReaderToParser.kt index 235876a4..28e7b052 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaReaderToParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/MangaReaderToParser.kt @@ -146,17 +146,17 @@ internal class MangaReaderToParser(context: MangaLoaderContext) : return document.select(".block_area_authors-other .manga_list-sbs .manga-poster, .featured-block-ul .manga-poster") .map { val mangaUrl = it.attrAsRelativeUrl("href") - val thumb = it.select("img") + val thumb = it.selectFirstOrThrow("img") Manga( id = generateUid(mangaUrl), url = mangaUrl, publicUrl = mangaUrl.toAbsoluteUrl(domain), title = thumb.attr("alt"), - coverUrl = thumb.attr("src"), + coverUrl = thumb.attrAsAbsoluteUrlOrNull("src"), source = source, altTitle = null, author = null, - isNsfw = false, + contentRating = null, rating = RATING_UNKNOWN, state = null, tags = emptySet(), diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/NineMangaParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/NineMangaParser.kt index edb67a4b..370ac47c 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/NineMangaParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/NineMangaParser.kt @@ -114,7 +114,7 @@ internal abstract class NineMangaParser( publicUrl = href, title = dd?.selectFirst("a.bookname")?.text()?.toCamelCase().orEmpty(), altTitle = null, - coverUrl = node.selectFirst("img")?.src().orEmpty(), + coverUrl = node.selectFirst("img")?.src(), rating = RATING_UNKNOWN, author = null, isNsfw = false, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/NineNineNineHentaiParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/NineNineNineHentaiParser.kt index 5928464b..5d8f330b 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/NineNineNineHentaiParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/all/NineNineNineHentaiParser.kt @@ -203,7 +203,7 @@ internal class NineNineNineHentaiParser(context: MangaLoaderContext) : altTitle = name, coverUrl = when { cover?.startsWith("http") == true -> cover - cover == null -> "" + cover == null -> null else -> "https://${cdnHost.get()}/$cover" }, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/animebootstrap/AnimeBootstrapParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/animebootstrap/AnimeBootstrapParser.kt index 994f65ee..083b1858 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/animebootstrap/AnimeBootstrapParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/animebootstrap/AnimeBootstrapParser.kt @@ -104,7 +104,8 @@ internal abstract class AnimeBootstrapParser( id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirstOrThrow("div.product__item__pic").attr("data-setbg").orEmpty(), + coverUrl = div.selectFirstOrThrow("div.product__item__pic") + .attrAsAbsoluteUrlOrNull("data-setbg"), title = div.selectFirstOrThrow("div.product__item__text").text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/animebootstrap/fr/PapScan.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/animebootstrap/fr/PapScan.kt index 5dec556c..17575dc1 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/animebootstrap/fr/PapScan.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/animebootstrap/fr/PapScan.kt @@ -66,7 +66,8 @@ internal class PapScan(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirstOrThrow("div.product__item__pic").attr("data-setbg").orEmpty(), + coverUrl = div.selectFirstOrThrow("div.product__item__pic") + .attrAsAbsoluteUrlOrNull("data-setbg"), title = div.selectFirstOrThrow("div.product__item__text h5").text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ar/MangaStorm.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ar/MangaStorm.kt index e85b3534..9e6c410f 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ar/MangaStorm.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ar/MangaStorm.kt @@ -75,7 +75,7 @@ internal class MangaStorm(context: MangaLoaderContext) : PagedMangaParser(contex publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = false, - coverUrl = div.selectFirstOrThrow("img").src().orEmpty(), + coverUrl = div.selectFirstOrThrow("img").src(), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ar/TeamXNovel.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ar/TeamXNovel.kt index 876bd023..838fef71 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ar/TeamXNovel.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ar/TeamXNovel.kt @@ -109,7 +109,7 @@ internal class TeamXNovel(context: MangaLoaderContext) : PagedMangaParser(contex publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = false, - coverUrl = div.selectFirstOrThrow("img").src()?.replace("thumbnail_", "").orEmpty(), + coverUrl = div.selectFirstOrThrow("img").src()?.replace("thumbnail_", ""), tags = emptySet(), state = when (div.selectFirst(".status")?.text()) { "مستمرة" -> MangaState.ONGOING diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/cupfox/CupFoxParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/cupfox/CupFoxParser.kt index 17b3be28..95b362d4 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/cupfox/CupFoxParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/cupfox/CupFoxParser.kt @@ -100,8 +100,7 @@ internal abstract class CupFoxParser( publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = false, - coverUrl = li.selectFirst(selectMangasCover) - ?.src().orEmpty(), + coverUrl = li.selectFirst(selectMangasCover)?.src(), tags = setOf(), state = null, author = null, @@ -166,7 +165,7 @@ internal abstract class CupFoxParser( publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = false, - coverUrl = li.selectFirst(selectMangasCover)?.src().orEmpty(), + coverUrl = li.selectFirst(selectMangasCover)?.src(), tags = setOf(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/AsuraScansParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/AsuraScansParser.kt index 02427559..ad7208ad 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/AsuraScansParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/AsuraScansParser.kt @@ -111,7 +111,7 @@ internal class AsuraScansParser(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(domain), - coverUrl = a.selectFirst("img")?.src().orEmpty(), + coverUrl = a.selectFirst("img")?.src(), title = a.selectFirst("div.block > span.block")?.text().orEmpty(), altTitle = null, rating = a.selectFirst("div.block label.ml-1")?.text()?.toFloatOrNull()?.div(10f) ?: RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/BeeToon.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/BeeToon.kt index 0924068c..02139da4 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/BeeToon.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/BeeToon.kt @@ -73,7 +73,7 @@ internal class BeeToon(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirst(".name")?.text().orEmpty(), altTitle = null, rating = div.selectFirst(".counter")?.text()?.toFloatOrNull()?.div(5f) ?: RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/DynastyScans.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/DynastyScans.kt index 6c27a14d..307cba23 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/DynastyScans.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/DynastyScans.kt @@ -112,7 +112,7 @@ internal class DynastyScans(context: MangaLoaderContext) : publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = false, - coverUrl = "", + coverUrl = null, tags = div.select("span.tags a").mapToSet { a -> MangaTag( key = a.attr("href").removeSuffix('/').substringAfterLast('/'), diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/FlameComics.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/FlameComics.kt index 3cb8fd6a..1d918536 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/FlameComics.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/FlameComics.kt @@ -141,7 +141,7 @@ internal class FlameComics(context: MangaLoaderContext) : coverUrl = if (cover != null) { imageUrl(seriesId, cover, 256) } else { - "" + null }, tags = jo.getStringOrNull("categories")?.let { JSONArray(it).asTypedList().mapToSet { tagName -> tagName.toMangaTag() } diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MangaGeko.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MangaGeko.kt index bdfb6a85..0a51a07a 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MangaGeko.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MangaGeko.kt @@ -85,10 +85,10 @@ internal class MangaGeko(context: MangaLoaderContext) : PagedMangaParser(context publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = false, - coverUrl = div.selectFirstOrThrow("img").src().orEmpty(), + coverUrl = div.selectFirstOrThrow("img").src(), tags = emptySet(), state = null, - author = div.selectFirstOrThrow("h6").text().removePrefix("Author(S): "), + author = div.selectFirstOrThrow("h6").text().removePrefix("Author(S): ").nullIfEmpty(), source = source, ) } diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MangaKawaiiEn.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MangaKawaiiEn.kt index 7b563ee3..6a9766da 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MangaKawaiiEn.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MangaKawaiiEn.kt @@ -81,7 +81,7 @@ internal class MangaKawaiiEn(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = (div.selectFirst("img")?.src() ?: a.attr("data-bg")).orEmpty(), + coverUrl = div.selectFirst("img")?.src() ?: a.attrAsAbsoluteUrlOrNull("data-bg"), title = div.selectFirstOrThrow("h4, .media-thumbnail__name").text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MangaTownParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MangaTownParser.kt index 2916122b..21b0f34f 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MangaTownParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MangaTownParser.kt @@ -113,7 +113,7 @@ internal class MangaTownParser(context: MangaLoaderContext) : Manga( id = generateUid(href), title = a.attr("title"), - coverUrl = a.selectFirst("img")?.absUrl("src").orEmpty(), + coverUrl = a.selectFirst("img")?.attrAsAbsoluteUrlOrNull("src"), source = MangaParserSource.MANGATOWN, altTitle = null, rating = li.selectFirst("p.score")?.selectFirst("b") diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Mangaowl.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Mangaowl.kt index f28f9156..6809c4f4 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Mangaowl.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Mangaowl.kt @@ -104,7 +104,7 @@ internal class Mangaowl(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirst("a.one-line")?.text().orEmpty(), altTitle = null, rating = div.select("span").last()?.text()?.toFloatOrNull()?.div(5f) ?: RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Manhwa18Com.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Manhwa18Com.kt index f957f62f..e12df687 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Manhwa18Com.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Manhwa18Com.kt @@ -130,7 +130,7 @@ internal class Manhwa18Com(context: MangaLoaderContext) : publicUrl = absUrl, rating = RATING_UNKNOWN, isNsfw = true, - coverUrl = it.selectFirst("div.img-in-ratio")?.attrAsAbsoluteUrl("data-bg").orEmpty(), + coverUrl = it.selectFirst("div.img-in-ratio")?.attrAsAbsoluteUrl("data-bg"), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Manhwa18Parser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Manhwa18Parser.kt index 738c541a..a8f05117 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Manhwa18Parser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Manhwa18Parser.kt @@ -130,7 +130,7 @@ internal class Manhwa18Parser(context: MangaLoaderContext) : publicUrl = absUrl, rating = RATING_UNKNOWN, isNsfw = true, - coverUrl = it.selectFirst("div.img-in-ratio")?.attrAsAbsoluteUrl("data-bg").orEmpty(), + coverUrl = it.selectFirst("div.img-in-ratio")?.attrAsAbsoluteUrl("data-bg"), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/ManhwasMen.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/ManhwasMen.kt index 0b2b41bf..1e80f7bc 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/ManhwasMen.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/ManhwasMen.kt @@ -83,7 +83,7 @@ internal class ManhwasMen(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(domain), - coverUrl = li.selectFirst("img")?.src().orEmpty(), + coverUrl = li.selectFirst("img")?.src(), title = li.selectFirst(".title")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MyComicList.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MyComicList.kt index 467b2997..2a62d70b 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MyComicList.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MyComicList.kt @@ -78,7 +78,7 @@ internal class MyComicList(context: MangaLoaderContext) : PagedMangaParser(conte tags = emptySet(), rating = RATING_UNKNOWN, isNsfw = isNsfwSource, - coverUrl = img?.attr("data-src").orEmpty(), + coverUrl = img?.attrAsAbsoluteUrlOrNull("data-src"), state = null, source = source, ) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Po2Scans.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Po2Scans.kt index f68bae24..1aee7e95 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Po2Scans.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Po2Scans.kt @@ -50,7 +50,7 @@ internal class Po2Scans(context: MangaLoaderContext) : SinglePageMangaParser(con publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = false, - coverUrl = div.selectFirstOrThrow("img").src()?.toAbsoluteUrl(domain).orEmpty(), + coverUrl = div.selectFirstOrThrow("img").src(), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Pururin.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Pururin.kt index 6c865000..a9ecefbe 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Pururin.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/Pururin.kt @@ -94,7 +94,7 @@ internal class Pururin(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(domain), - coverUrl = a.selectFirst("img.card-img-top")?.src().orEmpty(), + coverUrl = a.selectFirst("img.card-img-top")?.src(), title = a.selectFirst(".title")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, @@ -170,7 +170,7 @@ internal class Pururin(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(domain), - coverUrl = a.selectFirst("img.card-img-top")?.src().orEmpty(), + coverUrl = a.selectFirst("img.card-img-top")?.src(), title = a.selectFirst(".title")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/VyManga.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/VyManga.kt index 51b51560..b0f6869f 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/VyManga.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/VyManga.kt @@ -105,7 +105,7 @@ internal class VyManga(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(domain), - coverUrl = div.selectFirst(".comic-image img")?.src().orEmpty(), + coverUrl = div.selectFirst(".comic-image img")?.src(), title = div.selectFirst(".comic-title")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/WeebCentral.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/WeebCentral.kt index c2e8f83a..dd2d8389 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/WeebCentral.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/WeebCentral.kt @@ -1,20 +1,25 @@ package org.koitharu.kotatsu.parsers.site.en -import kotlinx.coroutines.* +import kotlinx.coroutines.async +import kotlinx.coroutines.coroutineScope import okhttp3.HttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl -import org.jsoup.nodes.* -import org.koitharu.kotatsu.parsers.* +import org.jsoup.nodes.Document +import org.jsoup.nodes.Element +import org.koitharu.kotatsu.parsers.MangaLoaderContext +import org.koitharu.kotatsu.parsers.MangaParser +import org.koitharu.kotatsu.parsers.MangaParserAuthProvider +import org.koitharu.kotatsu.parsers.MangaSourceParser import org.koitharu.kotatsu.parsers.config.ConfigKey import org.koitharu.kotatsu.parsers.model.* -import org.koitharu.kotatsu.parsers.model.MangaState.* +import org.koitharu.kotatsu.parsers.model.ContentRating.SAFE +import org.koitharu.kotatsu.parsers.model.ContentRating.SUGGESTIVE import org.koitharu.kotatsu.parsers.model.ContentType.* +import org.koitharu.kotatsu.parsers.model.MangaState.* import org.koitharu.kotatsu.parsers.model.SortOrder.* -import org.koitharu.kotatsu.parsers.model.ContentRating.* import org.koitharu.kotatsu.parsers.util.* import java.text.SimpleDateFormat -import java.util.EnumSet -import java.util.Locale +import java.util.* @MangaSourceParser("WEEBCENTRAL", "Weeb Central", "en") internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, MangaParserSource.WEEBCENTRAL), @@ -65,27 +70,27 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M MangaTag( title = it.selectFirstOrThrow(".label-text").text(), key = it.selectFirstOrThrow("input[id$=value]").attr("value"), - source = source + source = source, ) } val states = EnumSet.of( - ONGOING, FINISHED, ABANDONED, PAUSED + ONGOING, FINISHED, ABANDONED, PAUSED, ) val types = EnumSet.of( - MANGA, MANHWA, MANHUA, COMICS + MANGA, MANHWA, MANHUA, COMICS, ) val rating = EnumSet.of( - SAFE, SUGGESTIVE + SAFE, SUGGESTIVE, ) return MangaListFilterOptions( availableTags = tags, availableStates = states, availableContentTypes = types, - availableContentRating = rating + availableContentRating = rating, ) } @@ -110,7 +115,7 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M ADDED, ADDED_ASC -> "Recently Added" UPDATED, UPDATED_ASC -> "Latest Updates" else -> throw UnsupportedOperationException("unsupported order: $order") - } + }, ) addQueryParameter( name = "order", @@ -118,11 +123,11 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M RELEVANCE, ALPHABETICAL, POPULARITY_ASC, RATING_ASC, ADDED_ASC, UPDATED_ASC -> "Ascending" ALPHABETICAL_DESC, POPULARITY, RATING, ADDED, UPDATED -> "Descending" else -> throw UnsupportedOperationException("unsupported order: $order") - } + }, ) addQueryParameter("official", "Any") addQueryParameter("anime", "Any") - with (filter.contentRating) { + with(filter.contentRating) { addQueryParameter( name = "adult", value = when { @@ -131,7 +136,7 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M SAFE in this -> "False" SUGGESTIVE in this -> "True" else -> throw UnsupportedOperationException("unsupported content rating: $this") - } + }, ) } filter.states.forEach { state -> @@ -143,7 +148,7 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M ABANDONED -> "Canceled" PAUSED -> "Hiatus" else -> throw UnsupportedOperationException("unsupported state: $state") - } + }, ) } filter.types.forEach { type -> @@ -155,7 +160,7 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M MANHUA -> "Manhua" COMICS -> "OEL" else -> throw UnsupportedOperationException("unsupported type: $type") - } + }, ) } filter.tags.forEach { tag -> @@ -194,21 +199,21 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M MangaTag( title = it, key = it, - source = source + source = source, ) } .orEmpty(), - state = when(document.selectFirst("div:contains(status) span")?.text()) { + state = when (document.selectFirst("div:contains(status) span")?.text()) { "Ongoing" -> ONGOING "Complete" -> FINISHED "Canceled" -> ABANDONED "Hiatus" -> PAUSED else -> null }, - author = document.select("div:contains(author) a").eachText().joinToString(), + author = document.select("div:contains(author) a").eachText().joinToString().nullIfEmpty(), largeCoverUrl = null, chapters = null, - source = source + source = source, ) } } @@ -238,7 +243,7 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M MangaTag( title = it.text(), key = it.text(), - source = source + source = source, ) }, state = when (sectionLeft.selectFirst("ul > li:has(strong:contains(Status)) > a")?.text()) { @@ -260,12 +265,12 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M abbr.selectFirst("a")?.attr("href")?.let { url -> val a = Element("a") .text( - abbr.attr("title") + abbr.attr("title"), ) .attr("href", url) ul.appendChild( - Element("li").appendChild(a) + Element("li").appendChild(a), ) } } @@ -276,7 +281,7 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M } }.outerHtml(), chapters = chapters.await(), - source = source + source = source, ) } @@ -308,10 +313,10 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M else -> null }, uploadDate = dateFormat.tryParse( - element.selectFirst("time[datetime]")?.attr("datetime") + element.selectFirst("time[datetime]")?.attr("datetime"), ), branch = null, - source = source + source = source, ) } } @@ -336,7 +341,7 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M id = generateUid(pageUrl), url = pageUrl, preview = null, - source = source + source = source, ) } } diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/es/TempleScanEsp.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/es/TempleScanEsp.kt index 28b7b31d..d4fd978e 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/es/TempleScanEsp.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/es/TempleScanEsp.kt @@ -8,6 +8,7 @@ import org.koitharu.kotatsu.parsers.config.ConfigKey import org.koitharu.kotatsu.parsers.model.* import org.koitharu.kotatsu.parsers.network.UserAgents import org.koitharu.kotatsu.parsers.util.* +import org.koitharu.kotatsu.parsers.util.json.getStringOrNull import org.koitharu.kotatsu.parsers.util.json.mapJSON import java.text.DateFormat import java.text.SimpleDateFormat @@ -41,9 +42,9 @@ internal class TempleScanEsp(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href, - coverUrl = it.getString("urlImg").orEmpty(), + coverUrl = it.getString("urlImg"), title = it.getString("name").orEmpty(), - altTitle = it.getString("alternativeName").orEmpty(), + altTitle = it.getStringOrNull("alternativeName"), rating = RATING_UNKNOWN, tags = emptySet(), author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fmreader/FmreaderParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fmreader/FmreaderParser.kt index bb2b89f5..0ee2cf06 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fmreader/FmreaderParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fmreader/FmreaderParser.kt @@ -142,7 +142,7 @@ internal abstract class FmreaderParser( publicUrl = href.toAbsoluteUrl(div.host ?: domain), coverUrl = (div.selectFirst("div.img-in-ratio")?.attr("data-bg") ?: div.selectFirst("div.img-in-ratio")?.attr("style")?.substringAfter("(") - ?.substringBefore(")"))?.toAbsoluteUrl(domain).orEmpty(), + ?.substringBefore(")"))?.toAbsoluteUrl(domain), title = div.selectFirst("div.series-title")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/foolslide/FoolSlideParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/foolslide/FoolSlideParser.kt index 343c9069..76fd4689 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/foolslide/FoolSlideParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/foolslide/FoolSlideParser.kt @@ -88,7 +88,7 @@ internal abstract class FoolSlideParser( id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(),// in search no img + coverUrl = div.selectFirst("img")?.src(),// in search no img title = div.selectFirst(".title a")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/foolslide/es/SeinagiAdulto.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/foolslide/es/SeinagiAdulto.kt index 42b10257..e2e6b368 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/foolslide/es/SeinagiAdulto.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/foolslide/es/SeinagiAdulto.kt @@ -33,7 +33,7 @@ internal class SeinagiAdulto(context: MangaLoaderContext) : null } manga.copy( - coverUrl = doc.selectFirst(".thumbnail img")?.src().orEmpty(),// for manga result on search + coverUrl = doc.selectFirst(".thumbnail img")?.src(),// for manga result on search description = desc?.nullIfEmpty(), author = author?.nullIfEmpty(), chapters = chapters, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/BentomangaParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/BentomangaParser.kt index 469e6391..d484ba13 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/BentomangaParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/BentomangaParser.kt @@ -124,7 +124,7 @@ internal class BentomangaParser(context: MangaLoaderContext) : ?.div(10f) ?: RATING_UNKNOWN, isNsfw = div.selectFirst(".badge-adult_content") != null, - coverUrl = div.selectFirst("img")?.src().assertNotNull("src").orEmpty(), + coverUrl = div.selectFirst("img")?.src().assertNotNull("src"), tags = div.selectFirst(".component-manga-categories") .assertNotNull("tags") ?.select("a") diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/FuryoSociety.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/FuryoSociety.kt index 2fac73ac..0b977225 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/FuryoSociety.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/FuryoSociety.kt @@ -69,7 +69,7 @@ internal class FuryoSociety(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (div.selectFirst("div.media-body") ?: div.selectFirst("a"))?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/LegacyScansParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/LegacyScansParser.kt index b4cbf8e9..b81accfb 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/LegacyScansParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/LegacyScansParser.kt @@ -158,7 +158,7 @@ internal class LegacyScansParser(context: MangaLoaderContext) : publicUrl = urlManga, rating = RATING_UNKNOWN, isNsfw = false, - coverUrl = "", + coverUrl = null, tags = setOf(), state = null, author = null, @@ -178,7 +178,7 @@ internal class LegacyScansParser(context: MangaLoaderContext) : source = source, ) }, - coverUrl = root.selectFirst("div.serieImg img")?.attr("src"), + coverUrl = root.selectFirst("div.serieImg img")?.attrAsAbsoluteUrlOrNull("src"), author = root.select("div.serieAdd p:contains(Auteur:) strong").textOrNull(), description = root.selectFirst("div.serieDescription div")?.html(), chapters = root.select("div.chapterList a") diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/MangaKawaii.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/MangaKawaii.kt index 18e5b5f8..6b666f46 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/MangaKawaii.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/MangaKawaii.kt @@ -80,7 +80,7 @@ internal class MangaKawaii(context: MangaLoaderContext) : PagedMangaParser(conte id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = (div.selectFirst("img")?.src() ?: a.attr("data-bg")).orEmpty(), + coverUrl = div.selectFirst("img")?.src() ?: a.attrAsAbsoluteUrlOrNull("data-bg"), title = div.selectFirst("h4, .media-thumbnail__name")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/MangaMana.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/MangaMana.kt index bf768540..8a171e0c 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/MangaMana.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/MangaMana.kt @@ -121,7 +121,7 @@ internal class MangaMana(context: MangaLoaderContext) : PagedMangaParser(context publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = isNsfw, - coverUrl = img.orEmpty(), + coverUrl = img, description = null, tags = emptySet(), state = null, @@ -184,7 +184,7 @@ internal class MangaMana(context: MangaLoaderContext) : PagedMangaParser(context publicUrl = href.toAbsoluteUrl(domain), rating = div.getElementById("avgrating")?.ownText()?.toFloatOrNull()?.div(5f) ?: RATING_UNKNOWN, isNsfw = isNsfw, - coverUrl = img.orEmpty(), + coverUrl = img, description = div.selectFirst(".mangalist_item_description")?.text().orEmpty(), tags = div.select("div.mb-1 a").mapToSet { val key = it.attr("href").substringAfterLast('=') diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/ScansMangasMe.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/ScansMangasMe.kt index 6972afe3..8739e569 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/ScansMangasMe.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/ScansMangasMe.kt @@ -81,7 +81,7 @@ internal class ScansMangasMe(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirstOrThrow("div.bigor div.tt").text().orEmpty(), altTitle = null, rating = div.selectFirstOrThrow("div.rating i").ownText().toFloatOrNull()?.div(10f) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/ScantradUnion.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/ScantradUnion.kt index cd462824..7291a7dd 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/ScantradUnion.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fr/ScantradUnion.kt @@ -89,7 +89,7 @@ internal class ScantradUnion(context: MangaLoaderContext) : publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = false, - coverUrl = article.selectFirst("img.attachment-thumbnail")?.attrAsAbsoluteUrl("src").orEmpty(), + coverUrl = article.selectFirst("img.attachment-thumbnail")?.attrAsAbsoluteUrl("src"), tags = setOf(), state = null, author = null, @@ -109,7 +109,7 @@ internal class ScantradUnion(context: MangaLoaderContext) : publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = false, - coverUrl = article.selectFirst("img")?.attrAsAbsoluteUrl("src").orEmpty(), + coverUrl = article.selectFirst("img")?.attrAsAbsoluteUrl("src"), tags = setOf(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fuzzydoodle/FuzzyDoodleParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fuzzydoodle/FuzzyDoodleParser.kt index d6088614..19b5e1fc 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fuzzydoodle/FuzzyDoodleParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/fuzzydoodle/FuzzyDoodleParser.kt @@ -147,7 +147,7 @@ internal abstract class FuzzyDoodleParser( id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirst("h2")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/GalleryAdultsParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/GalleryAdultsParser.kt index 000478e5..110ebda9 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/GalleryAdultsParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/GalleryAdultsParser.kt @@ -114,7 +114,7 @@ internal abstract class GalleryAdultsParser( publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = isNsfwSource, - coverUrl = div.selectFirst(selectGalleryImg)?.src().orEmpty(), + coverUrl = div.selectFirst(selectGalleryImg)?.src(), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/DoujinDesuUk.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/DoujinDesuUk.kt index c2b6d43e..62ee184d 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/DoujinDesuUk.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/DoujinDesuUk.kt @@ -44,7 +44,7 @@ internal class DoujinDesuUk(context: MangaLoaderContext) : publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = isNsfwSource, - coverUrl = div.selectLastOrThrow(selectGalleryImg).src().orEmpty(), + coverUrl = div.selectLastOrThrow(selectGalleryImg).src(), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/NHentaiParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/NHentaiParser.kt index 57ed5fc5..72a0449e 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/NHentaiParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/NHentaiParser.kt @@ -95,7 +95,7 @@ internal class NHentaiParser(context: MangaLoaderContext) : publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = isNsfwSource, - coverUrl = div.selectFirstOrThrow(selectGalleryImg).src().orEmpty(), + coverUrl = div.selectFirstOrThrow(selectGalleryImg).src(), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/NHentaiToParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/NHentaiToParser.kt index 2c9d1b07..1066f186 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/NHentaiToParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/NHentaiToParser.kt @@ -85,12 +85,12 @@ internal class NHentaiToParser(context: MangaLoaderContext) : publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, contentRating = ContentRating.ADULT, - coverUrl = div.selectFirstOrThrow(selectGalleryImg).src().orEmpty(), + coverUrl = div.selectFirstOrThrow(selectGalleryImg).src(), tags = emptySet(), state = null, author = null, largeCoverUrl = null, - description = "N/A", + description = null, chapters = null, source = source, ) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/NHentaiXxxParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/NHentaiXxxParser.kt index 5b43c0e6..59f6e305 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/NHentaiXxxParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/galleryadults/all/NHentaiXxxParser.kt @@ -66,7 +66,7 @@ internal class NHentaiXxxParser(context: MangaLoaderContext) : joiner.add(tag.title) } - if(!filter.query.isNullOrEmpty()) { + if (!filter.query.isNullOrEmpty()) { joiner.add(filter.query.urlEncoded()) } append(joiner.complete()) @@ -98,12 +98,12 @@ internal class NHentaiXxxParser(context: MangaLoaderContext) : publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, contentRating = ContentRating.ADULT, - coverUrl = div.selectFirstOrThrow(selectGalleryImg).src().orEmpty(), + coverUrl = div.selectFirstOrThrow(selectGalleryImg).src(), tags = emptySet(), state = null, author = null, largeCoverUrl = null, - description = "N/A", + description = null, chapters = null, source = source, ) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/gattsu/GattsuParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/gattsu/GattsuParser.kt index c66f854e..f169aab2 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/gattsu/GattsuParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/gattsu/GattsuParser.kt @@ -78,7 +78,7 @@ internal abstract class GattsuParser( url = href, publicUrl = href, title = li.selectLast(".thumb-titulo, .video-titulo")?.text().orEmpty(), - coverUrl = li.selectFirst("img")?.src().orEmpty(), + coverUrl = li.selectFirst("img")?.src(), altTitle = null, rating = RATING_UNKNOWN, tags = emptySet(), diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/gattsu/pt/MundoHentaiOficial.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/gattsu/pt/MundoHentaiOficial.kt index 4f1c354c..c135761e 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/gattsu/pt/MundoHentaiOficial.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/gattsu/pt/MundoHentaiOficial.kt @@ -29,7 +29,7 @@ internal class MundoHentaiOficial(context: MangaLoaderContext) : url = href, publicUrl = href, title = li.selectLastOrThrow(".thumb-titulo, .video-titulo").text(), - coverUrl = li.selectFirst("img")?.src().orEmpty(), + coverUrl = li.selectFirst("img")?.src(), altTitle = null, rating = RATING_UNKNOWN, tags = emptySet(), diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/heancmsalt/HeanCmsAlt.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/heancmsalt/HeanCmsAlt.kt index c2f944c8..30f726ac 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/heancmsalt/HeanCmsAlt.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/heancmsalt/HeanCmsAlt.kt @@ -65,7 +65,7 @@ internal abstract class HeanCmsAlt( id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirst(selectMangaTitle)?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/hotcomics/HotComicsParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/hotcomics/HotComicsParser.kt index c00c2bf4..bad4b3af 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/hotcomics/HotComicsParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/hotcomics/HotComicsParser.kt @@ -105,7 +105,7 @@ internal abstract class HotComicsParser( id = generateUid(url), url = url, publicUrl = url.toAbsoluteUrl(domain), - coverUrl = li.selectFirst("img")?.src().orEmpty(), + coverUrl = li.selectFirst("img")?.src(), title = li.selectFirst(".title")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/DoujinDesuParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/DoujinDesuParser.kt index c92ae232..c4a0fa8d 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/DoujinDesuParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/DoujinDesuParser.kt @@ -121,7 +121,7 @@ internal class DoujinDesuParser(context: MangaLoaderContext) : publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = true, - coverUrl = it.selectFirst(".thumbnail > img")?.src().orEmpty(), + coverUrl = it.selectFirst(".thumbnail > img")?.src(), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/HentaiCrot.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/HentaiCrot.kt index 16df73ad..e4e987b6 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/HentaiCrot.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/HentaiCrot.kt @@ -66,7 +66,7 @@ internal class HentaiCrot(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src()?.replace("-200x285", "").orEmpty(), + coverUrl = div.selectFirst("img")?.src()?.replace("-200x285", ""), title = div.selectFirst("h2")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/PixHentai.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/PixHentai.kt index d597ec47..aed4b271 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/PixHentai.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/PixHentai.kt @@ -66,7 +66,7 @@ internal class PixHentai(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src()?.replace("-200x285", "").orEmpty(), + coverUrl = div.selectFirst("img")?.src()?.replace("-200x285", ""), title = div.selectFirst("h2")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/iken/IkenParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/iken/IkenParser.kt index 62ca74dc..c381a37e 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/iken/IkenParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/iken/IkenParser.kt @@ -105,7 +105,7 @@ internal abstract class IkenParser( id = it.getLong("id"), url = url, publicUrl = url.toAbsoluteUrl(domain), - coverUrl = it.getString("featuredImage").orEmpty(), + coverUrl = it.getString("featuredImage"), title = it.getString("postTitle"), altTitle = it.getString("alternativeTitles"), description = it.getString("postContent"), diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ja/NicovideoSeigaParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ja/NicovideoSeigaParser.kt index 439c2f58..7141392e 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ja/NicovideoSeigaParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ja/NicovideoSeigaParser.kt @@ -87,7 +87,7 @@ internal class NicovideoSeigaParser(context: MangaLoaderContext) : Manga( id = generateUid(href), title = item.selectFirst(".mg_body > .title > a")?.text() ?: return@mapNotNull null, - coverUrl = item.selectFirst(".comic_icon > div > a > img")?.attrAsAbsoluteUrl("src").orEmpty(), + coverUrl = item.selectFirst(".comic_icon > div > a > img")?.attrAsAbsoluteUrl("src"), altTitle = null, author = item.selectFirst(".mg_description_header > .mg_author > a")?.text(), rating = RATING_UNKNOWN, @@ -200,7 +200,7 @@ internal class NicovideoSeigaParser(context: MangaLoaderContext) : isNsfw = false, source = source, coverUrl = item.selectFirst(".search_result__item__thumbnail > a > img") - ?.attrAsAbsoluteUrl("data-original").orEmpty(), + ?.attrAsAbsoluteUrl("data-original"), ) } } diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/keyoapp/KeyoappParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/keyoapp/KeyoappParser.kt index f74ab8a9..901d7a6a 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/keyoapp/KeyoappParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/keyoapp/KeyoappParser.kt @@ -127,7 +127,7 @@ internal abstract class KeyoappParser( id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = cover?.styleValueOrNull("background-image")?.cssUrl().orEmpty(), + coverUrl = cover?.styleValueOrNull("background-image")?.cssUrl(), title = div.selectFirstOrThrow("h3").text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/likemanga/LikeMangaParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/likemanga/LikeMangaParser.kt index 36826964..6971cde0 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/likemanga/LikeMangaParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/likemanga/LikeMangaParser.kt @@ -116,7 +116,7 @@ internal abstract class LikeMangaParser( publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = false, - coverUrl = div.selectFirstOrThrow("img").src().orEmpty(), + coverUrl = div.selectFirstOrThrow("img").src(), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/liliana/LilianaParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/liliana/LilianaParser.kt index 7e655c99..5fadc720 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/liliana/LilianaParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/liliana/LilianaParser.kt @@ -114,7 +114,7 @@ internal abstract class LilianaParser( id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(domain), - coverUrl = element.selectFirst("img")?.src().orEmpty(), + coverUrl = element.selectFirst("img")?.src(), title = element.selectFirst(".text-center a")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/MadaraParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/MadaraParser.kt index 5a61e581..4d3cdb00 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/MadaraParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/MadaraParser.kt @@ -464,7 +464,7 @@ internal abstract class MadaraParser( id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (summary?.selectFirst("h3, h4") ?: div.selectFirst(".manga-name, .post-title"))?.text() .orEmpty(), altTitle = null, @@ -661,7 +661,7 @@ internal abstract class MadaraParser( altTitle = null, title = div.selectFirstOrThrow(".widget-title").text(), author = null, - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), tags = emptySet(), rating = RATING_UNKNOWN, state = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/all/Manga18Fx.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/all/Manga18Fx.kt index e6f7c0c9..ef0d03c3 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/all/Manga18Fx.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/all/Manga18Fx.kt @@ -69,7 +69,7 @@ internal class Manga18Fx(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirstOrThrow("h3").text().orEmpty(), altTitle = null, rating = div.selectFirst("div.item-rate span")?.ownText()?.toFloatOrNull()?.div(5f) ?: -1f, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/all/Manhwa18Cc.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/all/Manhwa18Cc.kt index 5af2ce15..604c19f1 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/all/Manhwa18Cc.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/all/Manhwa18Cc.kt @@ -75,7 +75,7 @@ internal class Manhwa18Cc(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirstOrThrow("h3").text().orEmpty(), altTitle = null, rating = div.selectFirst(".item-rate span")?.ownText()?.toFloatOrNull()?.div(5f) ?: -1f, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/FireScans.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/FireScans.kt index 2b8ccbd0..eaa041cd 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/FireScans.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/FireScans.kt @@ -24,7 +24,7 @@ internal class FireScans(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (summary?.selectFirst("h3") ?: summary?.selectFirst("h4") ?: div.selectFirst(".manga-name"))?.text().orEmpty(), altTitle = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/Hentai4Free.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/Hentai4Free.kt index afe8d9b2..234ef9ca 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/Hentai4Free.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/Hentai4Free.kt @@ -106,7 +106,7 @@ internal class Hentai4Free(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (summary?.selectFirst("h3") ?: summary?.selectFirst("h4") ?: div.selectFirst(".manga-name"))?.text().orEmpty(), altTitle = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/IsekaiScan.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/IsekaiScan.kt index f23b79c1..e8001bb3 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/IsekaiScan.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/IsekaiScan.kt @@ -81,7 +81,7 @@ internal class IsekaiScan(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (summary?.selectFirst("h3") ?: summary?.selectFirst("h4"))?.text().orEmpty(), altTitle = null, rating = div.selectFirst("span.total_votes")?.ownText()?.toFloatOrNull()?.div(5f) ?: -1f, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/IsekaiScanEuParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/IsekaiScanEuParser.kt index 60672113..6bfa10c7 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/IsekaiScanEuParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/IsekaiScanEuParser.kt @@ -103,7 +103,7 @@ internal class IsekaiScanEuParser(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (summary?.selectFirst("h3") ?: summary?.selectFirst("h4") ?: summary?.selectFirst("div.post-title p.juduldepan"))?.text().orEmpty(), altTitle = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/MangaDass.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/MangaDass.kt index 08e57436..1578df10 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/MangaDass.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/MangaDass.kt @@ -79,7 +79,7 @@ internal class MangaDass(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (summary?.selectFirst("h3") ?: summary?.selectFirst("h4"))?.text().orEmpty(), altTitle = null, rating = div.selectFirst("span.total_votes")?.ownText()?.toFloatOrNull()?.div(5f) ?: -1f, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/MangaDna.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/MangaDna.kt index 71385fe8..fc50e95b 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/MangaDna.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/MangaDna.kt @@ -72,7 +72,7 @@ internal class MangaDna(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (summary?.selectFirst("h3") ?: summary?.selectFirst("h4"))?.text().orEmpty(), altTitle = null, rating = div.selectFirst("div.hitem-rate span")?.ownText()?.toFloatOrNull()?.div(5f) ?: -1f, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/MangaPure.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/MangaPure.kt index e31287b3..031cf04c 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/MangaPure.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/MangaPure.kt @@ -86,7 +86,7 @@ internal class MangaPure(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (summary?.selectFirst("h3") ?: summary?.selectFirst("h4"))?.text().orEmpty(), altTitle = null, rating = div.selectFirst("span.total_votes")?.ownText()?.toFloatOrNull()?.div(5f) ?: -1f, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/Manhwaz.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/Manhwaz.kt index 87d57724..49ea96a8 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/Manhwaz.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/Manhwaz.kt @@ -75,7 +75,7 @@ internal class Manhwaz(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (summary?.selectFirst("h3") ?: summary?.selectFirst("h4"))?.text().orEmpty(), altTitle = null, rating = div.selectFirst("span.total_votes")?.ownText()?.toFloatOrNull()?.div(5f) ?: -1f, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/ShibaManga.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/ShibaManga.kt index a956ccb6..470c8e09 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/ShibaManga.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/en/ShibaManga.kt @@ -25,7 +25,7 @@ internal class ShibaManga(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (summary?.selectFirst("h3") ?: summary?.selectFirst("h4") ?: div.selectFirst("div.post-title a"))?.text().orEmpty(), altTitle = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/es/DragonTranslationParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/es/DragonTranslationParser.kt index 65f2e2ea..2ec549c3 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/es/DragonTranslationParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/es/DragonTranslationParser.kt @@ -62,7 +62,7 @@ internal class DragonTranslationParser(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img.thumb-img")?.src().orEmpty(), + coverUrl = div.selectFirst("img.thumb-img")?.src(), title = div.selectFirst("div.series-box h5")?.text().orEmpty(), altTitle = null, rating = div.selectFirst("span.total_votes")?.ownText()?.toFloatOrNull()?.div(5f) ?: -1f, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/es/TmoManga.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/es/TmoManga.kt index 97c5abc9..f0186c5f 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/es/TmoManga.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/es/TmoManga.kt @@ -70,7 +70,7 @@ internal class TmoManga(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirstOrThrow("h3").text(), altTitle = null, rating = div.selectFirst("span.total_votes")?.ownText()?.toFloatOrNull()?.div(5f) ?: -1f, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/id/ManhwaHub.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/id/ManhwaHub.kt index 5fe6d88a..9b43234a 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/id/ManhwaHub.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/id/ManhwaHub.kt @@ -70,7 +70,7 @@ internal class ManhwaHub(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (summary?.selectFirst("h3") ?: summary?.selectFirst("h4") ?: div.selectFirst("h5.series-title"))?.text().orEmpty(), altTitle = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/ja/MangaFenxi.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/ja/MangaFenxi.kt index b59c81dc..b3eba37c 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/ja/MangaFenxi.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/ja/MangaFenxi.kt @@ -9,16 +9,8 @@ import org.koitharu.kotatsu.parsers.model.MangaParserSource import org.koitharu.kotatsu.parsers.model.MangaState import org.koitharu.kotatsu.parsers.model.MangaTag import org.koitharu.kotatsu.parsers.site.madara.MadaraParser -import org.koitharu.kotatsu.parsers.util.attrAsRelativeUrlOrNull -import org.koitharu.kotatsu.parsers.util.domain -import org.koitharu.kotatsu.parsers.util.generateUid -import org.koitharu.kotatsu.parsers.util.host -import org.koitharu.kotatsu.parsers.util.mapNotNullToSet -import org.koitharu.kotatsu.parsers.util.parseFailed -import org.koitharu.kotatsu.parsers.util.removeSuffix -import org.koitharu.kotatsu.parsers.util.toAbsoluteUrl -import org.koitharu.kotatsu.parsers.util.toTitleCase -import java.util.Locale +import org.koitharu.kotatsu.parsers.util.* +import java.util.* @Broken @MangaSourceParser("MANGAFENXI", "MangaFenxi", "ja") @@ -37,7 +29,7 @@ internal class MangaFenxi(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.attr("src")?.replace("-193x278", "").orEmpty(), + coverUrl = div.selectFirst("img")?.attr("src")?.replace("-193x278", ""), title = (summary?.selectFirst("h3") ?: summary?.selectFirst("h4") ?: div.selectFirst(".manga-name") ?: div.selectFirst(".post-title"))?.text().orEmpty(), altTitle = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/vi/Saytruyenhay.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/vi/Saytruyenhay.kt index 14b8692c..86a78cc1 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/vi/Saytruyenhay.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/vi/Saytruyenhay.kt @@ -76,7 +76,7 @@ internal class Saytruyenhay(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (summary?.selectFirst("h3") ?: summary?.selectFirst("h4"))?.text().orEmpty(), altTitle = null, rating = div.selectFirst("span.total_votes")?.ownText()?.toFloatOrNull()?.div(5f) ?: -1f, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madtheme/MadthemeParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madtheme/MadthemeParser.kt index 4ddd47b4..1d879cfe 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madtheme/MadthemeParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madtheme/MadthemeParser.kt @@ -119,7 +119,7 @@ internal abstract class MadthemeParser( id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirst("div.meta")?.selectFirst("div.title")?.text().orEmpty(), altTitle = null, rating = div.selectFirst("div.meta span.score")?.ownText()?.toFloatOrNull()?.div(5f) ?: RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/manga18/Manga18Parser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/manga18/Manga18Parser.kt index 4c0945e2..ecf2bd24 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/manga18/Manga18Parser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/manga18/Manga18Parser.kt @@ -107,7 +107,7 @@ internal abstract class Manga18Parser( id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirst("div.mg_info")?.selectFirst("div.mg_name a")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/manga18/en/Hentai3zCc.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/manga18/en/Hentai3zCc.kt index 84e563a1..b9d7a0aa 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/manga18/en/Hentai3zCc.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/manga18/en/Hentai3zCc.kt @@ -23,8 +23,7 @@ internal class Hentai3zCc(context: MangaLoaderContext) : publicUrl = href.toAbsoluteUrl(div.host ?: domain), coverUrl = div.selectFirst("img")?.src() ?.replace("cover_thumb_2.webp", "cover_250x350.jpg") - ?.replace("admin.manga18.us", "bk.18porncomic.com") - .orEmpty(), + ?.replace("admin.manga18.us", "bk.18porncomic.com"), title = div.selectFirst("div.mg_info")?.selectFirst("div.mg_name a")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/MangaboxParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/MangaboxParser.kt index b008e266..342f815e 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/MangaboxParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/MangaboxParser.kt @@ -126,7 +126,7 @@ internal abstract class MangaboxParser( id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirst("h3")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/en/Mangairo.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/en/Mangairo.kt index fb19b4c4..b62473b8 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/en/Mangairo.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/en/Mangairo.kt @@ -96,7 +96,7 @@ internal class Mangairo(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = (div.selectFirst("h2")?.text() ?: div.selectFirst("h3")?.text()).orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/en/Mangakakalot.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/en/Mangakakalot.kt index 8c77b79a..7b3512c5 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/en/Mangakakalot.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/en/Mangakakalot.kt @@ -85,7 +85,7 @@ internal class Mangakakalot(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirst("h3")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/en/MangakakalotTv.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/en/MangakakalotTv.kt index 3ec07a94..66b81b75 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/en/MangakakalotTv.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangabox/en/MangakakalotTv.kt @@ -82,7 +82,7 @@ internal class MangakakalotTv(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirstOrThrow("h3").text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/MangaReaderParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/MangaReaderParser.kt index 262e43ba..2424b5f5 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/MangaReaderParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/MangaReaderParser.kt @@ -164,7 +164,7 @@ internal abstract class MangaReaderParser( publicUrl = a.attrAsAbsoluteUrl("href"), rating = rating, isNsfw = isNsfwSource, - coverUrl = it.selectFirst(selectMangaListImg)?.src().orEmpty(), + coverUrl = it.selectFirst(selectMangaListImg)?.src(), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/fr/RevolutionScantrad.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/fr/RevolutionScantrad.kt index e3522f91..fa7b016e 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/fr/RevolutionScantrad.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/fr/RevolutionScantrad.kt @@ -101,7 +101,7 @@ internal class RevolutionScantrad(context: MangaLoaderContext) : publicUrl = a.attrAsAbsoluteUrl("href"), rating = rating, isNsfw = isNsfwSource, - coverUrl = it.selectFirst(selectMangaListImg)?.src().orEmpty(), + coverUrl = it.selectFirst(selectMangaListImg)?.src(), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/fr/XxxRevolutionScantrad.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/fr/XxxRevolutionScantrad.kt index dd94661e..90e0ce75 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/fr/XxxRevolutionScantrad.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/fr/XxxRevolutionScantrad.kt @@ -95,7 +95,7 @@ internal class XxxRevolutionScantrad(context: MangaLoaderContext) : publicUrl = a.attrAsAbsoluteUrl("href"), rating = rating, isNsfw = isNsfwSource, - coverUrl = it.selectFirst(selectMangaListImg)?.src().orEmpty(), + coverUrl = it.selectFirst(selectMangaListImg)?.src(), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/id/Komikcast.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/id/Komikcast.kt index 82f7e247..45a7ce0a 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/id/Komikcast.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangareader/id/Komikcast.kt @@ -148,7 +148,7 @@ internal class Komikcast(context: MangaLoaderContext) : publicUrl = a.attrAsAbsoluteUrl("href"), rating = rating, isNsfw = isNsfwSource, - coverUrl = it.selectFirst("img.ts-post-image")?.src().orEmpty(), + coverUrl = it.selectFirst("img.ts-post-image")?.src(), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangaworld/MangaWorldParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangaworld/MangaWorldParser.kt index a86c1ccf..f72621af 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangaworld/MangaWorldParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mangaworld/MangaWorldParser.kt @@ -148,7 +148,7 @@ internal abstract class MangaWorldParser( id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(domain), - coverUrl = div.selectFirst(".thumb img")?.attr("src").orEmpty(), + coverUrl = div.selectFirst(".thumb img")?.attr("src"), title = div.selectFirst(".name a.manga-title")?.text().orEmpty(), altTitle = null, rating = RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mmrcms/MmrcmsParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mmrcms/MmrcmsParser.kt index 6b6e5134..e47f938e 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mmrcms/MmrcmsParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mmrcms/MmrcmsParser.kt @@ -126,7 +126,7 @@ internal abstract class MmrcmsParser( id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirst("div.media-body h5")?.text().orEmpty(), altTitle = null, rating = div.selectFirst("span")?.ownText()?.toFloatOrNull()?.div(5f) ?: RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mmrcms/ar/Onma.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mmrcms/ar/Onma.kt index 5823b15c..ba298faf 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mmrcms/ar/Onma.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/mmrcms/ar/Onma.kt @@ -30,7 +30,7 @@ internal class Onma(context: MangaLoaderContext) : id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirstOrThrow("h5.media-heading").text().orEmpty(), altTitle = null, rating = div.selectFirstOrThrow("span").ownText().toFloatOrNull()?.div(5f) ?: RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/onemanga/OneMangaParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/onemanga/OneMangaParser.kt index 78a44957..0b0bd09f 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/onemanga/OneMangaParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/onemanga/OneMangaParser.kt @@ -36,7 +36,7 @@ internal abstract class OneMangaParser( id = generateUid(url), url = url, publicUrl = url, - coverUrl = doc.selectFirst("div.elementor-widget-container img")?.src().orEmpty(), + coverUrl = doc.selectFirst("div.elementor-widget-container img")?.src(), title = doc.selectFirst("ul.elementor-nav-menu li a")?.text().orEmpty(), altTitle = doc.selectFirst("div.elementor-widget-text-editor ul li:contains(Nom(s) Alternatif(s))") ?.text()?.replace("Nom(s) Alternatif(s) :", "").orEmpty(), diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/otakusanctuary/OtakuSanctuaryParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/otakusanctuary/OtakuSanctuaryParser.kt index a82cb385..abeb1bc9 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/otakusanctuary/OtakuSanctuaryParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/otakusanctuary/OtakuSanctuaryParser.kt @@ -110,7 +110,7 @@ internal abstract class OtakuSanctuaryParser( id = generateUid(href), url = href, publicUrl = href.toAbsoluteUrl(div.host ?: domain), - coverUrl = div.selectFirst("img")?.src().orEmpty(), + coverUrl = div.selectFirst("img")?.src(), title = div.selectFirst("h4")?.text().orEmpty(), altTitle = null, rating = div.selectFirst(".rating")?.ownText()?.toFloatOrNull()?.div(10f) ?: RATING_UNKNOWN, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/pt/BrMangas.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/pt/BrMangas.kt index f0122a50..345ba944 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/pt/BrMangas.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/pt/BrMangas.kt @@ -99,7 +99,7 @@ internal class BrMangas(context: MangaLoaderContext) : PagedMangaParser(context, publicUrl = href.toAbsoluteUrl(domain), rating = RATING_UNKNOWN, isNsfw = false, - coverUrl = div.selectFirstOrThrow("img").src().orEmpty(), + coverUrl = div.selectFirstOrThrow("img").src(), tags = emptySet(), state = null, author = null, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/pt/LerManga.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/pt/LerManga.kt index cf91ec60..f81a9352 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/pt/LerManga.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/pt/LerManga.kt @@ -88,7 +88,7 @@ internal class LerManga(context: MangaLoaderContext) : PagedMangaParser(context, url = href, publicUrl = href, title = div.selectLastOrThrow("h3.film-name").text(), - coverUrl = div.selectFirst("img.film-poster-img")?.src().orEmpty(), + coverUrl = div.selectFirst("img.film-poster-img")?.src(), altTitle = null, rating = div.selectFirst(".item__rating")?.ownText()?.toFloatOrNull()?.div(5f) ?: RATING_UNKNOWN, tags = emptySet(), diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/WaMangaParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/WaMangaParser.kt index 943b5aa7..f8132c63 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/WaMangaParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ru/WaMangaParser.kt @@ -63,7 +63,11 @@ internal class WaMangaParser( }, author = doc.getStringOrNull("author"), source = source, - contentRating = if (doc.getIntOrDefault("adult", 0) == 0) ContentRating.SAFE else ContentRating.ADULT, + contentRating = if (doc.getIntOrDefault("adult", 0) == 0) { + ContentRating.SAFE + } else { + ContentRating.ADULT + }, ) }