[skip ci] Address some compiler deprecation warnings (#12086)

This commit is contained in:
arkon 2022-06-05 16:07:57 -04:00 committed by GitHub
parent b75257d818
commit 86d04b11b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
74 changed files with 113 additions and 121 deletions

View File

@ -50,8 +50,8 @@ class Manhwa18 : FMReader("Manhwa18", "https://manhwa18.com", "en") {
info.select(".info-name:contains(Other name:) + .info-value")
.firstOrNull()?.text()?.let {
val altName = removeGenericWords(it)
description = when (title.toLowerCase(Locale.US)) {
altName.toLowerCase(Locale.US) -> description
description = when (title.lowercase(Locale.US)) {
altName.lowercase(Locale.US) -> description
else -> description + "\n\n$altName"
}
}
@ -64,7 +64,7 @@ class Manhwa18 : FMReader("Manhwa18", "https://manhwa18.com", "en") {
private fun removeGenericWords(name: String): String {
val excludeList = listOf("manhwa", "engsub")
return name.split(' ').filterNot { word ->
word.toLowerCase(Locale.US) in excludeList
word.lowercase(Locale.US) in excludeList
}.joinToString(" ")
}

View File

@ -5,7 +5,7 @@ import java.util.Locale
class LeCercleDuScan : FoolSlide("Le Cercle du Scan", "https://lel.lecercleduscan.com", "fr") {
override fun parseChapterDate(date: String) = super.parseChapterDate(
when (val lcDate = date.toLowerCase(Locale.FRENCH)) {
when (val lcDate = date.lowercase(Locale.FRENCH)) {
"hier" -> "yesterday"
"aujourd'hui" -> "today"
"demain" -> "tomorrow"

View File

@ -56,20 +56,20 @@ class MangasOrigines : Madara("Mangas Origines", "https://mangas-origines.fr", "
}
}
val genres = select("div.genres-content a")
.map { element -> element.text().toLowerCase(Locale.ROOT) }
.map { element -> element.text().lowercase(Locale.ROOT) }
.toMutableSet()
// add tag(s) to genre
select("div.tags-content a").forEach { element ->
if (genres.contains(element.text()).not()) {
genres.add(element.text().toLowerCase(Locale.ROOT))
genres.add(element.text().lowercase(Locale.ROOT))
}
}
// add manga/manhwa/manhua thinggy to genre
document.select(seriesTypeSelector).firstOrNull()?.ownText()?.let {
if (it.isEmpty().not() && it.notUpdating() && it != "-" && genres.contains(it).not()) {
genres.add(it.toLowerCase(Locale.ROOT))
genres.add(it.lowercase(Locale.ROOT))
}
}

View File

@ -59,7 +59,7 @@ class ManhwaNelo : Madara("ManhwaNelo", "https://manhwanelo.com", "en") {
}
}
manga.genre = select("div.genres a")
.joinToString(", ") { element -> element.text().toLowerCase(Locale.ROOT) }
.joinToString(", ") { element -> element.text().lowercase(Locale.ROOT) }
return manga
}

View File

@ -37,20 +37,20 @@ class MidnightMessScans : Madara("Midnight Mess Scans", "https://midnightmess.or
}
}
val genres = select("div.genres-content a")
.map { element -> element.text().toLowerCase(Locale.ROOT) }
.map { element -> element.text().lowercase(Locale.ROOT) }
.toMutableSet()
// add tag(s) to genre
select("div.tags-content a").forEach { element ->
if (genres.contains(element.text()).not()) {
genres.add(element.text().toLowerCase(Locale.ROOT))
genres.add(element.text().lowercase(Locale.ROOT))
}
}
// add manga/manhwa/manhua thinggy to genre
document.select(seriesTypeSelector).firstOrNull()?.ownText()?.let {
if (it.isEmpty().not() && it.notUpdating() && it != "-" && genres.contains(it).not()) {
genres.add(it.toLowerCase(Locale.ROOT))
genres.add(it.lowercase(Locale.ROOT))
}
}

View File

@ -66,7 +66,7 @@ class AnimaRegia : MMRCMS("AnimaRegia", "https://animaregia.net", "pt-BR") {
description = document.select("div.row div.well p").text().trim()
for (element in document.select("div.col-sm-5 ul.list-group li.list-group-item")) {
when (element.text().trim().toLowerCase(BRAZILIAN_LOCALE).substringBefore(":")) {
when (element.text().trim().lowercase(BRAZILIAN_LOCALE).substringBefore(":")) {
"autor(es)" -> author = element.select("a")
.joinToString(", ") { it.text().trim() }
"artist(s)" -> artist = element.select("a")

View File

@ -44,13 +44,13 @@ class AsuraScansTr : AsuraScans("https://tr.asurascans.com", "tr", SimpleDateFor
thumbnail_url = infoElement.select("div.thumb img").imgAttr()
val genres = infoElement.select(".mgen a")
.map { element -> element.text().toLowerCase(Locale.ROOT) }
.map { element -> element.text().lowercase(Locale.ROOT) }
.toMutableSet()
// add series type(manga/manhwa/manhua/other) thinggy to genre
document.select(seriesTypeSelector).firstOrNull()?.ownText()?.let {
if (it.isEmpty().not() && genres.contains(it).not()) {
genres.add(it.toLowerCase(Locale.ROOT))
genres.add(it.lowercase(Locale.ROOT))
}
}

View File

@ -38,13 +38,13 @@ class MangaSwat : WPMangaStream("MangaSwat", "https://swatmanga.co", "ar", Simpl
thumbnail_url = infoElement.select("img").imgAttr()
val genres = infoElement.select("span:contains(التصنيف) a, .mgen a")
.map { element -> element.text().toLowerCase() }
.map { element -> element.text().lowercase() }
.toMutableSet()
// add series type(manga/manhwa/manhua/other) thinggy to genre
document.select(seriesTypeSelector).firstOrNull()?.ownText()?.let {
if (it.isEmpty().not() && genres.contains(it).not()) {
genres.add(it.toLowerCase())
genres.add(it.lowercase())
}
}

View File

@ -50,13 +50,13 @@ class Mihentai : WPMangaStream("Mihentai", "https://mihentai.com", "en") {
thumbnail_url = infoElement.select("div.thumb img").imgAttr()
val genres = infoElement.select("span:contains(Tag) a")
.map { element -> element.text().toLowerCase(Locale.ROOT) }
.map { element -> element.text().lowercase(Locale.ROOT) }
.toMutableSet()
// add series type(manga/manhwa/manhua/other) thinggy to genre
document.select("span:contains(Type)").firstOrNull()?.ownText()?.let {
if (it.isEmpty().not() && genres.contains(it).not()) {
genres.add(it.toLowerCase(Locale.ROOT))
genres.add(it.lowercase(Locale.ROOT))
}
}

View File

@ -152,7 +152,7 @@ abstract class FoolSlide(
}
protected open fun parseChapterDate(date: String): Long? {
val lcDate = date.toLowerCase(Locale.ROOT)
val lcDate = date.lowercase(Locale.ROOT)
if (lcDate.endsWith(" ago"))
parseRelativeDate(lcDate)?.let { return it }

View File

@ -50,7 +50,7 @@ abstract class GigaViewer(
protected val dayOfWeek: String by lazy {
Calendar.getInstance()
.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG, Locale.US)!!
.toLowerCase(Locale.US)
.lowercase(Locale.US)
}
protected open val publisher: String = ""

View File

@ -652,14 +652,14 @@ abstract class Madara(
}
}
val genres = select(mangaDetailsSelectorGenre)
.map { element -> element.text().toLowerCase(Locale.ROOT) }
.map { element -> element.text().lowercase(Locale.ROOT) }
.toMutableSet()
// add tag(s) to genre
if (mangaDetailsSelectorTag.isNotEmpty()) {
select(mangaDetailsSelectorTag).forEach { element ->
if (genres.contains(element.text()).not()) {
genres.add(element.text().toLowerCase(Locale.ROOT))
genres.add(element.text().lowercase(Locale.ROOT))
}
}
}
@ -667,7 +667,7 @@ abstract class Madara(
// add manga/manhwa/manhua thinggy to genre
document.select(seriesTypeSelector).firstOrNull()?.ownText()?.let {
if (it.isEmpty().not() && it.notUpdating() && it != "-" && genres.contains(it).not()) {
genres.add(it.toLowerCase(Locale.ROOT))
genres.add(it.lowercase(Locale.ROOT))
}
}

View File

@ -128,7 +128,7 @@ abstract class MadTheme(
(altNames.takeIf { it.isNotEmpty() }?.let { "\n\nAlt name(s): ${it.joinToString()}" } ?: "")
val statusText = document.select(".detail .meta > p > strong:contains(Status) ~ a").first()!!.text()
status = when (statusText.toLowerCase(Locale.US)) {
status = when (statusText.lowercase(Locale.US)) {
"ongoing" -> SManga.ONGOING
"completed" -> SManga.COMPLETED
else -> SManga.UNKNOWN

View File

@ -271,7 +271,7 @@ abstract class MangaBox(
// Based on change_alias JS function from Mangakakalot's website
@SuppressLint("DefaultLocale")
open fun normalizeSearchQuery(query: String): String {
var str = query.toLowerCase()
var str = query.lowercase()
str = str.replace("[àáạảãâầấậẩẫăằắặẳẵ]".toRegex(), "a")
str = str.replace("[èéẹẻẽêềếệểễ]".toRegex(), "e")
str = str.replace("[ìíịỉĩ]".toRegex(), "i")

View File

@ -69,8 +69,8 @@ abstract class MangaMainac(
private fun substringextract(text: String, start: String, end: String): String = text.substringAfter(start).substringBefore(end).trim()
private fun parseStatus(element: String): Int = when {
element.toLowerCase().contains("ongoing (pub") -> SManga.ONGOING
element.toLowerCase().contains("completed (pub") -> SManga.COMPLETED
element.lowercase().contains("ongoing (pub") -> SManga.ONGOING
element.lowercase().contains("completed (pub") -> SManga.COMPLETED
else -> SManga.UNKNOWN
}

View File

@ -299,13 +299,13 @@ abstract class MMRCMS(
val detailDescription = setOf("description", "resumen")
for (element in document.select(".row .dl-horizontal dt")) {
when (element.text().trim().toLowerCase().removeSuffix(":")) {
when (element.text().trim().lowercase().removeSuffix(":")) {
in detailAuthor -> author = element.nextElementSibling().text()
in detailArtist -> artist = element.nextElementSibling().text()
in detailGenre -> genre = element.nextElementSibling().select("a").joinToString {
it.text().trim()
}
in detailStatus -> status = when (element.nextElementSibling().text().trim().toLowerCase()) {
in detailStatus -> status = when (element.nextElementSibling().text().trim().lowercase()) {
in detailStatusComplete -> SManga.COMPLETED
in detailStatusOngoing -> SManga.ONGOING
else -> SManga.UNKNOWN
@ -314,13 +314,13 @@ abstract class MMRCMS(
}
// When details are in a .panel instead of .row (ES sources)
for (element in document.select("div.panel span.list-group-item")) {
when (element.select("b").text().toLowerCase().substringBefore(":")) {
when (element.select("b").text().lowercase().substringBefore(":")) {
in detailAuthor -> author = element.select("b + a").text()
in detailArtist -> artist = element.select("b + a").text()
in detailGenre -> genre = element.getElementsByTag("a").joinToString {
it.text().trim()
}
in detailStatus -> status = when (element.select("b + span.label").text().toLowerCase()) {
in detailStatus -> status = when (element.select("b + span.label").text().lowercase()) {
in detailStatusComplete -> SManga.COMPLETED
in detailStatusOngoing -> SManga.ONGOING
else -> SManga.UNKNOWN

View File

@ -19,7 +19,7 @@ class MMRCMSSources {
val lang: String,
override val isNsfw: Boolean = false,
override val className: String = name.replace(" ", ""),
override val pkgName: String = className.toLowerCase(Locale.ENGLISH),
override val pkgName: String = className.lowercase(Locale.ENGLISH),
override val sourceName: String = name,
override val overrideVersionCode: Int = 0,
) : SourceData()
@ -30,7 +30,7 @@ class MMRCMSSources {
val langs: List<String>,
override val isNsfw: Boolean = false,
override val className: String = name.replace(" ", "") + "Factory",
override val pkgName: String = className.substringBefore("Factory").toLowerCase(Locale.ENGLISH),
override val pkgName: String = className.substringBefore("Factory").lowercase(Locale.ENGLISH),
override val sourceName: String = name,
override val overrideVersionCode: Int = 0,
) : SourceData()

View File

@ -210,13 +210,13 @@ abstract class WPMangaStream(
thumbnail_url = infoElement.select("div.thumb img").imgAttr()
val genres = infoElement.select("span:contains(Genre) a, .mgen a")
.map { element -> element.text().toLowerCase() }
.map { element -> element.text().lowercase() }
.toMutableSet()
// add series type(manga/manhwa/manhua/other) thinggy to genre
document.select(seriesTypeSelector).firstOrNull()?.ownText()?.let {
if (it.isEmpty().not() && genres.contains(it).not()) {
genres.add(it.toLowerCase())
genres.add(it.lowercase())
}
}

View File

@ -206,7 +206,7 @@ abstract class EHentai(
thumbnailUrl = select("#gd1 div").attr("style").nullIfBlank()?.let {
it.substring(it.indexOf('(') + 1 until it.lastIndexOf(')'))
}
genre = select("#gdc div").text().nullIfBlank()?.trim()?.toLowerCase()
genre = select("#gdc div").text().nullIfBlank()?.trim()?.lowercase()
uploader = select("#gdn").text().nullIfBlank()?.trim()
@ -225,7 +225,7 @@ abstract class EHentai(
ignore {
when (
left.removeSuffix(":")
.toLowerCase()
.lowercase()
) {
"posted" -> datePosted = EX_DATE_FORMAT.parse(right)?.time ?: 0
"visible" -> visible = right.nullIfBlank()

View File

@ -104,7 +104,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, UnmeteredSource, Htt
val statusToInclude = mutableListOf<String>()
filter.state.forEach { content ->
if (content.state) {
statusToInclude.add(content.name.toUpperCase(Locale.ROOT))
statusToInclude.add(content.name.uppercase(Locale.ROOT))
}
}
if (statusToInclude.isNotEmpty()) {
@ -354,7 +354,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, UnmeteredSource, Htt
ReadFilter(),
TypeSelect(),
CollectionSelect(listOf(CollectionFilterEntry("None")) + collections.map { CollectionFilterEntry(it.name, it.id) }),
LibraryGroup(libraries.map { LibraryFilter(it.id, it.name) }.sortedBy { it.name.toLowerCase(Locale.ROOT) }),
LibraryGroup(libraries.map { LibraryFilter(it.id, it.name) }.sortedBy { it.name.lowercase(Locale.ROOT) }),
StatusGroup(listOf("Ongoing", "Ended", "Abandoned", "Hiatus").map { StatusFilter(it) }),
GenreGroup(genres.map { GenreFilter(it) }),
TagGroup(tags.map { TagFilter(it) }),
@ -385,7 +385,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, UnmeteredSource, Htt
// keep the previous ID when lang was "en", so that preferences and manga bindings are not lost
override val id by lazy {
val key = "${name.toLowerCase()}/en/$versionId"
val key = "${name.lowercase()}/en/$versionId"
val bytes = MessageDigest.getInstance("MD5").digest(key.toByteArray())
(0..7).map { bytes[it].toLong() and 0xff shl 8 * (7 - it) }.reduce(Long::or) and Long.MAX_VALUE
}

View File

@ -151,7 +151,7 @@ abstract class Luscious(
}
if (tagsFilter.state.isNotEmpty()) {
val tags = "+${tagsFilter.state.toLowerCase()}".replace(" ", "_")
val tags = "+${tagsFilter.state.lowercase()}".replace(" ", "_")
.replace("_,", "+").replace(",_", "+").replace(",", "+")
.replace("+-", "-").replace("-_", "-").trim()
add(

View File

@ -387,7 +387,7 @@ class MangaDexHelper(private val lang: String) {
}
fun titleToSlug(title: String) = title.trim()
.toLowerCase(Locale.US)
.lowercase(Locale.US)
.replace(titleSpecialCharactersRegex, "-")
.replace(trailingHyphenRegex, "")
.split("-")

View File

@ -17,10 +17,8 @@ import uy.kohesive.injekt.injectLazy
/**
* Rate limit requests ignore covers though
*/
private val coverRegex = Regex("""/images/.*\.jpg""")
private val baseInterceptor = RateLimitInterceptor(3)
val mdRateLimitInterceptor = Interceptor { chain ->
return@Interceptor when (chain.request().url.toString().contains(coverRegex)) {
true -> chain.proceed(chain.request())

View File

@ -186,9 +186,9 @@ open class MangaPark(
private fun String?.parseStatus() = if (this == null) {
SManga.UNKNOWN
} else when {
this.toLowerCase(Locale.US).contains("ongoing") -> SManga.ONGOING
this.toLowerCase(Locale.US).contains("hiatus") -> SManga.ONGOING
this.toLowerCase(Locale.US).contains("completed") -> SManga.COMPLETED
this.lowercase(Locale.US).contains("ongoing") -> SManga.ONGOING
this.lowercase(Locale.US).contains("hiatus") -> SManga.ONGOING
this.lowercase(Locale.US).contains("completed") -> SManga.COMPLETED
else -> SManga.UNKNOWN
}

View File

@ -160,7 +160,7 @@ open class MangaToon(
private fun String.toNormalPosterUrl(): String = replace(POSTER_SUFFIX, "$1")
private fun String.toStatus(): Int = when (toLowerCase(locale)) {
private fun String.toStatus(): Int = when (lowercase(locale)) {
in ONGOING_STATUS -> SManga.ONGOING
in COMPLETED_STATUS -> SManga.COMPLETED
else -> SManga.UNKNOWN

View File

@ -86,9 +86,9 @@ class Mango : ConfigurableSource, UnmeteredSource, HttpSource() {
// Here the best we can do is just match manga based on their titles
private fun searchMangaParse(response: Response, query: String): MangasPage {
val queryLower = query.toLowerCase()
val queryLower = query.lowercase()
val mangas = popularMangaParse(response).mangas
val exactMatch = mangas.firstOrNull { it.title.toLowerCase() == queryLower }
val exactMatch = mangas.firstOrNull { it.title.lowercase() == queryLower }
if (exactMatch != null) {
return MangasPage(listOf(exactMatch), false)
}
@ -99,13 +99,13 @@ class Mango : ConfigurableSource, UnmeteredSource, HttpSource() {
// Take results that potentially start the same
val results = mangas.filter {
val title = it.title.toLowerCase()
val title = it.title.lowercase()
val query2 = queryLower.take(7)
(title.startsWith(query2, true) || title.contains(query2, true))
}.sortedBy { textDistance.distance(queryLower, it.title.toLowerCase()) }
}.sortedBy { textDistance.distance(queryLower, it.title.lowercase()) }
// Take similar results
val results2 = mangas.map { Pair(textDistance2.distance(it.title.toLowerCase(), query), it) }
val results2 = mangas.map { Pair(textDistance2.distance(it.title.lowercase(), query), it) }
.filter { it.first < 0.3 }.sortedBy { it.first }.map { it.second }
val combinedResults = results.union(results2)

View File

@ -57,7 +57,7 @@ open class MyReadingManga(override val lang: String, private val siteLang: Strin
// Latest
@SuppressLint("DefaultLocale")
override fun latestUpdatesRequest(page: Int): Request {
return GET("$baseUrl/lang/${latestLang.toLowerCase()}" + if (page > 1) "/page/$page/" else "", headers) // Home Page - Latest Manga
return GET("$baseUrl/lang/${latestLang.lowercase()}" + if (page > 1) "/page/$page/" else "", headers) // Home Page - Latest Manga
}
override fun latestUpdatesNextPageSelector() = "li.pagination-next"

View File

@ -178,7 +178,7 @@ class Buttsmithy : HttpSource() {
}
private fun String.lowercase(): String {
return this.toLowerCase(Locale.getDefault())
return this.lowercase(Locale.getDefault())
}
/**

View File

@ -154,7 +154,7 @@ class Comicastle : ParsedHttpSource() {
)
private open class PostFilter(name: String, val vals: Array<String>) : Filter.Select<String>(name, vals) {
val pathSegment = name.toLowerCase(Locale.US)
val pathSegment = name.lowercase(Locale.US)
fun hasSelection(): Boolean = state != 0
fun toRequestBody(): RequestBody = createRequestBody(vals[state])
}

View File

@ -26,7 +26,6 @@ import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
import rx.Observable
import uy.kohesive.injekt.injectLazy
import java.lang.UnsupportedOperationException
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit

View File

@ -205,7 +205,7 @@ class HBrowse : ParsedHttpSource(), ConfigurableSource {
}
private class AdvTriStateFilter(val groupName: String, name: String) : Filter.TriState(name) {
val formName = "${groupName[0].toLowerCase() + groupName.drop(1).replace(" ", "")}_$name"
val formName = "${groupName[0].lowercase() + groupName.drop(1).replace(" ", "")}_$name"
fun formValue() = when {
this.isIncluded() -> "y"
this.isExcluded() -> "n"

View File

@ -67,7 +67,7 @@ class Hiveworks : ParsedHttpSource() {
// Latest
override fun latestUpdatesRequest(page: Int): Request {
val day = SimpleDateFormat("EEEE", Locale.US).format(Date()).toLowerCase(Locale.US)
val day = SimpleDateFormat("EEEE", Locale.US).format(Date()).lowercase(Locale.US)
return GET("$baseUrl/home/update-day/$day", headers)
}

View File

@ -101,7 +101,7 @@ class KillSixBillionDemons : HttpSource() {
}
private fun String.lowercase(): String {
return this.toLowerCase(Locale.ROOT)
return this.lowercase(Locale.ROOT)
}
/**

View File

@ -96,7 +96,7 @@ class MangaPark : ConfigurableSource, ParsedHttpSource() {
}
document.select(".attr > tbody > tr").forEach {
when (it.getElementsByTag("th").first().text().trim().toLowerCase()) {
when (it.getElementsByTag("th").first().text().trim().lowercase()) {
"author(s)" -> {
author = it.getElementsByTag("a").joinToString(transform = Element::text)
}
@ -107,7 +107,7 @@ class MangaPark : ConfigurableSource, ParsedHttpSource() {
genre = it.getElementsByTag("a").joinToString(transform = Element::text)
}
"status" -> {
status = when (it.getElementsByTag("td").text().trim().toLowerCase()) {
status = when (it.getElementsByTag("td").text().trim().lowercase()) {
"ongoing" -> SManga.ONGOING
"completed" -> SManga.COMPLETED
else -> SManga.UNKNOWN
@ -216,7 +216,7 @@ class MangaPark : ConfigurableSource, ParsedHttpSource() {
@SuppressLint("DefaultLocale")
private fun parseDate(date: String): Long {
val lcDate = date.toLowerCase()
val lcDate = date.lowercase()
if (lcDate.endsWith("ago")) return parseRelativeDate(lcDate)
// Handle 'yesterday' and 'today'

View File

@ -69,8 +69,8 @@ class MangaPill : ParsedHttpSource() {
private fun parseStatus(element: String): Int = when {
element.toLowerCase(Locale.ENGLISH).contains("publishing") -> SManga.ONGOING
element.toLowerCase(Locale.ENGLISH).contains("finished") -> SManga.COMPLETED
element.lowercase(Locale.ENGLISH).contains("publishing") -> SManga.ONGOING
element.lowercase(Locale.ENGLISH).contains("finished") -> SManga.COMPLETED
else -> SManga.UNKNOWN
}

View File

@ -67,14 +67,14 @@ class MangaRawClub : ParsedHttpSource() {
val manga = SManga.create()
val author = document.select(".author a").first()?.attr("title")?.trim() ?: ""
if (author.toLowerCase(Locale.ROOT) != "updating")
if (author.lowercase(Locale.ROOT) != "updating")
manga.author = author
var description = document.select(".description").first()?.text() ?: ""
description = description.substringAfter("The Summary is").trim()
val otherTitle = document.select(".alternative-title").first()?.text()?.trim() ?: ""
if (otherTitle.isNotEmpty() && otherTitle.toLowerCase(Locale.ROOT) != "updating")
if (otherTitle.isNotEmpty() && otherTitle.lowercase(Locale.ROOT) != "updating")
description += "\n\n$altName $otherTitle"
manga.description = description.trim()

View File

@ -319,7 +319,7 @@ class Multporn : ParsedHttpSource() {
get() {
return state.split(",").filter { it != "" }.map {
Regex("[^A-Za-z0-9]").replace(it, " ").trim()
.replace("\\s+".toRegex(), "_").toLowerCase(Locale.getDefault())
.replace("\\s+".toRegex(), "_").lowercase(Locale.getDefault())
}.distinct()
}
}

View File

@ -68,8 +68,8 @@ class NuxScans : ParsedHttpSource() {
}
private fun parseStatus(element: String): Int = when {
element.toLowerCase().contains("ongoing") -> SManga.ONGOING
element.toLowerCase().contains("completed") -> SManga.COMPLETED
element.lowercase().contains("ongoing") -> SManga.ONGOING
element.lowercase().contains("completed") -> SManga.COMPLETED
else -> SManga.UNKNOWN
}

View File

@ -102,7 +102,7 @@ class SwordsComic : HttpSource() {
charCount = 0
}
charCount += word.length + 1
builder.append(Uri.encode(word.toUpperCase()))
builder.append(Uri.encode(word.uppercase()))
builder.append("+")
}

View File

@ -48,7 +48,7 @@ class TimelessLeaf : HttpSource() {
// all mangas are in sub menus, go straight for that to deal with less menu items
val menuLinks = document.select(".sub-menu a").filterNot { element ->
element.text().toLowerCase(Locale.ROOT).contains(pagesWeDontWant)
element.text().lowercase(Locale.ROOT).contains(pagesWeDontWant)
}
// combine the two lists

View File

@ -29,7 +29,6 @@ import org.jsoup.Jsoup
import org.jsoup.parser.Parser
import rx.Observable
import uy.kohesive.injekt.injectLazy
import java.lang.Exception
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale

View File

@ -41,7 +41,7 @@ class ZeroScansHelper {
comics: List<ZeroScansComicDto>
): List<ZeroScansComicDto> {
var sortedList = when (type) {
"alphabetic" -> comics.sortedBy { it.name.toLowerCase(Locale.ROOT) }
"alphabetic" -> comics.sortedBy { it.name.lowercase(Locale.ROOT) }
"rating" -> comics.sortedBy { it.getRating() }
"chapter_count" -> comics.sortedBy { it.chapterCount }
"bookmark_count" -> comics.sortedBy { it.bookmarkCount }

View File

@ -130,8 +130,8 @@ class Ikuhentai : ParsedHttpSource() {
private fun parseStatus(element: String): Int = when {
element.toLowerCase().contains("ongoing") -> SManga.ONGOING
element.toLowerCase().contains("completado") -> SManga.COMPLETED
element.lowercase().contains("ongoing") -> SManga.ONGOING
element.lowercase().contains("completado") -> SManga.COMPLETED
else -> SManga.UNKNOWN
}

View File

@ -78,7 +78,7 @@ class Kumanga : HttpSource() {
val dt = body.select("#searchinput").attr("dt").toString()
val kumangaTokenKey = encodeAndReverse(encodeAndReverse(dt))
.replace("=", "k")
.toLowerCase(Locale.ROOT)
.lowercase(Locale.ROOT)
kumangaToken = body.select("div.input-group [type=hidden]").attr(kumangaTokenKey)
return kumangaToken
}

View File

@ -106,7 +106,7 @@ open class MangaMx : ConfigurableSource, ParsedHttpSource() {
for (filter in filters) {
when (filter) {
is StatusFilter -> uri.appendQueryParameter(
filter.name.toLowerCase(Locale.ROOT),
filter.name.lowercase(Locale.ROOT),
statusArray[filter.state].second
)
is SortBy -> {
@ -117,7 +117,7 @@ open class MangaMx : ConfigurableSource, ParsedHttpSource() {
)
}
is TypeFilter -> uri.appendQueryParameter(
filter.name.toLowerCase(Locale.ROOT),
filter.name.lowercase(Locale.ROOT),
typedArray[filter.state].second
)
is GenreFilter -> uri.appendQueryParameter(

View File

@ -123,7 +123,7 @@ class FuryoSquad : ParsedHttpSource() {
document.select("div.comic-info").let {
it.select("p.fs-comic-label").forEach { el ->
when (el.text().toLowerCase(Locale.ROOT)) {
when (el.text().lowercase(Locale.ROOT)) {
"scénario" -> manga.author = el.nextElementSibling().text()
"dessins" -> manga.artist = el.nextElementSibling().text()
"genre" -> manga.genre = el.nextElementSibling().text()
@ -151,7 +151,7 @@ class FuryoSquad : ParsedHttpSource() {
}
private fun parseChapterDate(date: String): Long {
val lcDate = date.toLowerCase(Locale.ROOT)
val lcDate = date.lowercase(Locale.ROOT)
if (lcDate.startsWith("il y a"))
parseRelativeDate(lcDate).let { return it }

View File

@ -180,7 +180,7 @@ class Japscan : ConfigurableSource, ParsedHttpSource() {
element.select("a").first().let {
manga.setUrlWithoutDomain(it.attr("href"))
manga.title = it.text()
manga.thumbnail_url = "$baseUrl/imgs/${it.attr("href").replace(Regex("/$"),".jpg").replace("manga","mangas")}".toLowerCase(Locale.ROOT)
manga.thumbnail_url = "$baseUrl/imgs/${it.attr("href").replace(Regex("/$"),".jpg").replace("manga","mangas")}".lowercase(Locale.ROOT)
}
return manga
}
@ -356,7 +356,7 @@ class Japscan : ConfigurableSource, ParsedHttpSource() {
val checkNew = ArrayList<String>(pagecount)
var maxIter = document.getElementsByTag("option").size
var isSinglePage = false
if ((zjs.toLowerCase(Locale.ROOT).split("new image").size - 1) == 1) {
if ((zjs.lowercase(Locale.ROOT).split("new image").size - 1) == 1) {
isSinglePage = true
maxIter = 1
}

View File

@ -161,7 +161,7 @@ class ScantradUnion : ParsedHttpSource() {
}
private fun mapMangaStatusStringToConst(status: String): Int {
return when (status.trim().toLowerCase(Locale.FRENCH)) {
return when (status.trim().lowercase(Locale.FRENCH)) {
"en cours" -> SManga.ONGOING
"terminé" -> SManga.COMPLETED
"licencié" -> SManga.LICENSED

View File

@ -91,8 +91,8 @@ class KomikFan : ParsedHttpSource() {
}
private fun parseStatus(element: String): Int = when {
element.toLowerCase().contains("ongoing") -> SManga.ONGOING
element.toLowerCase().contains("completed") -> SManga.COMPLETED
element.lowercase().contains("ongoing") -> SManga.ONGOING
element.lowercase().contains("completed") -> SManga.COMPLETED
else -> SManga.UNKNOWN
}

View File

@ -112,8 +112,8 @@ class Bacakomik : ParsedHttpSource() {
}
private fun parseStatus(element: String): Int = when {
element.toLowerCase().contains("berjalan") -> SManga.ONGOING
element.toLowerCase().contains("tamat") -> SManga.COMPLETED
element.lowercase().contains("berjalan") -> SManga.ONGOING
element.lowercase().contains("tamat") -> SManga.COMPLETED
else -> SManga.UNKNOWN
}

View File

@ -30,8 +30,8 @@ class DoujinDesu : ParsedHttpSource() {
}
private fun parseStatus(status: String) = when {
status.toLowerCase(Locale.US).contains("finished") -> SManga.ONGOING
status.toLowerCase(Locale.US).contains("publishing") -> SManga.COMPLETED
status.lowercase(Locale.US).contains("finished") -> SManga.ONGOING
status.lowercase(Locale.US).contains("publishing") -> SManga.COMPLETED
else -> SManga.UNKNOWN
}

View File

@ -70,7 +70,7 @@ class Mangaku : ParsedHttpSource() {
infoString.forEach {
if (it.contains("</b>")) {
val info = it.split("</b>")
val key = info[0].replace(":", "").replace("<b>", "").trim().toLowerCase()
val key = info[0].replace(":", "").replace("<b>", "").trim().lowercase()
val value = info[1].replace(":", "").trim()
when (key) {
"genre" -> manga.genre = value.replace("", ", ").replace("-", ", ").trim()
@ -163,7 +163,7 @@ class Mangaku : ParsedHttpSource() {
val mangas = arrayListOf<SManga>()
document.select(searchMangaSelector()).forEach { element ->
val manga = popularMangaFromElement(element)
if (manga.title.toLowerCase().contains(searchQuery.toLowerCase())) {
if (manga.title.lowercase().contains(searchQuery.lowercase())) {
mangas.add(manga)
}
}

View File

@ -82,8 +82,8 @@ class NyanFM : ParsedHttpSource() {
}
private fun parseStatus(element: String): Int = when {
element.toLowerCase().contains("ongoing") -> SManga.ONGOING
element.toLowerCase().contains("completed") -> SManga.COMPLETED
element.lowercase().contains("ongoing") -> SManga.ONGOING
element.lowercase().contains("completed") -> SManga.COMPLETED
else -> SManga.UNKNOWN
}

View File

@ -84,8 +84,8 @@ class DigitalTeam : ParsedHttpSource() {
}
private fun parseStatus(element: String): Int = when {
element.toLowerCase(Locale.ROOT).contains("in corso") -> SManga.ONGOING
element.toLowerCase(Locale.ROOT).contains("completo") -> SManga.COMPLETED
element.lowercase(Locale.ROOT).contains("in corso") -> SManga.ONGOING
element.lowercase(Locale.ROOT).contains("completo") -> SManga.COMPLETED
else -> SManga.UNKNOWN
}

View File

@ -76,7 +76,7 @@ class HentaiFantasy : ParsedHttpSource() {
filter.state
.filter { it.state }
.map {
paths.add(it.name.toLowerCase().replace(" ", "_"))
paths.add(it.name.lowercase().replace(" ", "_"))
it.id.toString()
}
.forEach { tags.add(it) }

View File

@ -166,9 +166,8 @@ class Mangaworld : ParsedHttpSource() {
}
private fun parseStatus(element: String): Int = when {
element.toLowerCase().contains("ongoing") -> SManga.ONGOING
element.toLowerCase().contains("completed") -> SManga.COMPLETED
element.lowercase().contains("ongoing") -> SManga.ONGOING
element.lowercase().contains("completed") -> SManga.COMPLETED
else -> SManga.UNKNOWN
}

View File

@ -26,7 +26,7 @@ class SenManga : ParsedHttpSource() {
override val client = super.client.newBuilder().addInterceptor {
// Intercept any image requests and add a referer to them
// Enables bandwidth stealing feature
val request = if (it.request().url.pathSegments.firstOrNull()?.trim()?.toLowerCase() == "viewer") {
val request = if (it.request().url.pathSegments.firstOrNull()?.trim()?.lowercase() == "viewer") {
it.request().newBuilder()
.addHeader(
"Referer",

View File

@ -173,7 +173,7 @@ class NewTokiWebtoon : NewToki("NewToki", "https://newtoki$domainNumber.com", "w
}
fun generateSourceId(name: String, lang: String, versionId: Int): Long {
val key = "${name.toLowerCase()}/$lang/$versionId"
val key = "${name.lowercase()}/$lang/$versionId"
val bytes = MessageDigest.getInstance("MD5").digest(key.toByteArray())
return (0..7).map { bytes[it].toLong() and 0xff shl 8 * (7 - it) }.reduce(Long::or) and Long.MAX_VALUE
}

View File

@ -19,7 +19,6 @@ import eu.kanade.tachiyomi.source.online.HttpSource
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.add
import kotlinx.serialization.json.decodeFromJsonElement
import kotlinx.serialization.json.jsonArray
import kotlinx.serialization.json.jsonObject

View File

@ -345,7 +345,7 @@ class HQNow : HttpSource() {
.replace("[^\\p{ASCII}]".toRegex(), "")
.replace("[^a-zA-Z0-9\\s]+".toRegex(), "").trim()
.replace("\\s+".toRegex(), "-")
.toLowerCase(Locale("pt", "BR"))
.lowercase(Locale("pt", "BR"))
}
private fun String.toStatus(): Int = when (this) {

View File

@ -326,7 +326,7 @@ class MangaVibe : HttpSource() {
.replace("[^\\p{ASCII}]".toRegex(), "")
.replace("[^a-zA-Z0-9\\s]+".toRegex(), "").trim()
.replace("\\s+".toRegex(), "-")
.toLowerCase(Locale("pt", "BR"))
.lowercase(Locale("pt", "BR"))
}
companion object {

View File

@ -72,7 +72,7 @@ class OnePieceEx : ParsedHttpSource() {
override fun popularMangaFromElement(element: Element): SManga = SManga.create().apply {
title = element.select("div.volume-nome h2").text() + " - " +
element.select("div.volume-nome h3").text()
thumbnail_url = THUMBNAIL_URL_MAP[title.toUpperCase(Locale.ROOT)] ?: DEFAULT_THUMBNAIL
thumbnail_url = THUMBNAIL_URL_MAP[title.uppercase(Locale.ROOT)] ?: DEFAULT_THUMBNAIL
val customUrl = "$baseUrl/mangas/".toHttpUrlOrNull()!!.newBuilder()
.addQueryParameter("type", "special")
@ -142,7 +142,7 @@ class OnePieceEx : ParsedHttpSource() {
val volumeEl = document.select("#post > div.volume:contains(" + title.substringAfter(" - ") + ")").first()!!
author = if (title.contains("One Piece")) "Eiichiro Oda" else "OPEX"
description = volumeEl.select("li.resenha").text()
thumbnail_url = THUMBNAIL_URL_MAP[title.toUpperCase(Locale.ROOT)] ?: DEFAULT_THUMBNAIL
thumbnail_url = THUMBNAIL_URL_MAP[title.uppercase(Locale.ROOT)] ?: DEFAULT_THUMBNAIL
}
}
}

View File

@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.extension.ru.allhentai
import android.app.Application
import android.content.SharedPreferences
import android.widget.Toast
import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess
@ -140,7 +139,7 @@ class AllHentai : ConfigurableSource, ParsedHttpSource() {
val infoElement = document.select(".expandable").first()
val rawCategory = infoElement.select("span.elem_category").text()
val category = if (rawCategory.isNotEmpty()) {
rawCategory.toLowerCase()
rawCategory.lowercase()
} else {
"манга"
}

View File

@ -259,7 +259,7 @@ class LibHentai : ConfigurableSource, HttpSource() {
when (
body.select("div.media-info-list__title:contains(Статус перевода) + div")
.text()
.toLowerCase(Locale.ROOT)
.lowercase(Locale.ROOT)
) {
"продолжается" -> SManga.ONGOING
"завершен" -> SManga.COMPLETED

View File

@ -250,7 +250,7 @@ class LibManga : ConfigurableSource, HttpSource() {
when (
body.select("div.media-info-list__title:contains(Статус перевода) + div")
.text()
.toLowerCase(Locale.ROOT)
.lowercase(Locale.ROOT)
) {
"продолжается" -> SManga.ONGOING
"завершен" -> SManga.COMPLETED

View File

@ -169,7 +169,7 @@ class Mangachan : ParsedHttpSource() {
val imgElement = document.select("img#cover").first()
val rawCategory = infoElement.select("tr:eq(1) > td:eq(1)").text()
val category = if (rawCategory.isNotEmpty()) {
rawCategory.toLowerCase()
rawCategory.lowercase()
} else {
"манга"
}

View File

@ -104,7 +104,7 @@ class MangaClub : ParsedHttpSource() {
}
description = "Читайте описание через WebView"
genre = document.select("div.info a[href*=tags]").joinToString(", ") {
it.text().replaceFirstChar { it.toUpperCase() }.trim()
it.text().replaceFirstChar { it.uppercase() }.trim()
}
}

View File

@ -147,7 +147,7 @@ class Mintmanga : ConfigurableSource, ParsedHttpSource() {
val infoElement = document.select(".expandable").first()
val rawCategory = infoElement.select("span.elem_category").text()
val category = if (rawCategory.isNotEmpty()) {
rawCategory.toLowerCase()
rawCategory.lowercase()
} else {
"манга"
}

View File

@ -147,7 +147,7 @@ class Readmanga : ConfigurableSource, ParsedHttpSource() {
val infoElement = document.select(".expandable").first()
val rawCategory = infoElement.select("span.elem_category").text()
val category = if (rawCategory.isNotEmpty()) {
rawCategory.toLowerCase()
rawCategory.lowercase()
} else {
"манга"
}

View File

@ -241,7 +241,7 @@ class UniComics : ParsedHttpSource() {
element.select(".list_title").first().text().let {
val titleNoPrefix = it.removePrefix(manga.title).removePrefix(":").trim()
chapter.name = if (titleNoPrefix.isNotEmpty())
titleNoPrefix.replaceFirst(titleNoPrefix.first(), titleNoPrefix.first().toUpperCase())
titleNoPrefix.replaceFirst(titleNoPrefix.first(), titleNoPrefix.first().uppercaseChar())
else
"Сингл"
if (titleNoPrefix.contains("")) {

View File

@ -131,7 +131,7 @@ class Yaoichan : ParsedHttpSource() {
val imgElement = document.select("img#cover").first()
val rawCategory = infoElement.select("tr:eq(1) > td:eq(1)").text()
val category = if (rawCategory.isNotEmpty()) {
rawCategory.toLowerCase()
rawCategory.lowercase()
} else {
"манга"
}

View File

@ -68,8 +68,8 @@ class IuTruyenTranh : ParsedHttpSource() {
is Author -> url.addQueryParameter("autart", filter.state)
is GenreList -> filter.state.forEach { genre ->
when (genre.state) {
Filter.TriState.STATE_INCLUDE -> genres.add(genre.name.toLowerCase())
Filter.TriState.STATE_EXCLUDE -> genresEx.add(genre.name.toLowerCase())
Filter.TriState.STATE_INCLUDE -> genres.add(genre.name.lowercase())
Filter.TriState.STATE_EXCLUDE -> genresEx.add(genre.name.lowercase())
}
}
}

View File

@ -51,7 +51,6 @@ class Jinmantiantang : ConfigurableSource, ParsedHttpSource() {
override val client: OkHttpClient = network.cloudflareClient
.newBuilder()
.addNetworkInterceptor(mainSiteRateLimitInterceptor)
// .addNetworkInterceptor(RateLimitInterceptor(1, 3))
.addInterceptor(ScrambledImageInterceptor).build()
// 点击量排序(人气)

View File

@ -61,7 +61,7 @@ class Picacomic : HttpSource(), ConfigurableSource {
val hmacSha256Key = "~d}\$Q7\$eIni=V)9\\RK/P.RM4;9[7|@/CA}b~OW!3?EV`:<>M7pddUBL5n|0/*Cn"
val apiKey = basicHeaders["api-key"]
val path = url.substringAfter("$baseUrl/")
val raw = "$path$time$nonce${method}$apiKey".toLowerCase(Locale.ROOT)
val raw = "$path$time$nonce${method}$apiKey".lowercase(Locale.ROOT)
return hmacSHA256(hmacSha256Key, raw).convertToString()
}