Address some deprecation warnings
This commit is contained in:
parent
9697bffc5e
commit
d30c9f7120
@ -9,7 +9,7 @@ interface UrlImportableSource : Source {
|
|||||||
val matchingHosts: List<String>
|
val matchingHosts: List<String>
|
||||||
|
|
||||||
fun matchesUri(uri: Uri): Boolean {
|
fun matchesUri(uri: Uri): Boolean {
|
||||||
return uri.host.orEmpty().toLowerCase() in matchingHosts
|
return uri.host.orEmpty().lowercase() in matchingHosts
|
||||||
}
|
}
|
||||||
|
|
||||||
fun mapUrlToChapterUrl(uri: Uri): String? = null
|
fun mapUrlToChapterUrl(uri: Uri): String? = null
|
||||||
|
@ -193,7 +193,7 @@ class EHentai(
|
|||||||
genre = getGenre(
|
genre = getGenre(
|
||||||
genreString = parsedGenre?.text()
|
genreString = parsedGenre?.text()
|
||||||
?.nullIfBlank()
|
?.nullIfBlank()
|
||||||
?.toLowerCase()
|
?.lowercase()
|
||||||
?.replace(" ", "")
|
?.replace(" ", "")
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -306,7 +306,7 @@ class EHentai(
|
|||||||
doc = client.newCall(exGet(baseUrl + url)).await().asJsoup()
|
doc = client.newCall(exGet(baseUrl + url)).await().asJsoup()
|
||||||
|
|
||||||
val parentLink = doc.select("#gdd .gdt1").find { el ->
|
val parentLink = doc.select("#gdd .gdt1").find { el ->
|
||||||
el.text().toLowerCase() == "parent:"
|
el.text().lowercase() == "parent:"
|
||||||
}!!.nextElementSibling().selectFirst("a")?.attr("href")
|
}!!.nextElementSibling().selectFirst("a")?.attr("href")
|
||||||
|
|
||||||
if (parentLink != null) {
|
if (parentLink != null) {
|
||||||
@ -335,7 +335,7 @@ class EHentai(
|
|||||||
number = 1f,
|
number = 1f,
|
||||||
dateUpload = MetadataUtil.EX_DATE_FORMAT.parse(
|
dateUpload = MetadataUtil.EX_DATE_FORMAT.parse(
|
||||||
doc.select("#gdd .gdt1").find { el ->
|
doc.select("#gdd .gdt1").find { el ->
|
||||||
el.text().toLowerCase() == "posted:"
|
el.text().lowercase() == "posted:"
|
||||||
}!!.nextElementSibling().text()
|
}!!.nextElementSibling().text()
|
||||||
)!!.time
|
)!!.time
|
||||||
)
|
)
|
||||||
@ -593,7 +593,7 @@ class EHentai(
|
|||||||
val right = rightElement.text().trimOrNull()
|
val right = rightElement.text().trimOrNull()
|
||||||
if (left != null && right != null) {
|
if (left != null && right != null) {
|
||||||
ignore {
|
ignore {
|
||||||
when (left.removeSuffix(":").toLowerCase()) {
|
when (left.removeSuffix(":").lowercase()) {
|
||||||
"posted" -> datePosted = MetadataUtil.EX_DATE_FORMAT.parse(right)!!.time
|
"posted" -> datePosted = MetadataUtil.EX_DATE_FORMAT.parse(right)!!.time
|
||||||
// Example gallery with parent: https://e-hentai.org/g/1390451/7f181c2426/
|
// Example gallery with parent: https://e-hentai.org/g/1390451/7f181c2426/
|
||||||
// Example JP gallery: https://exhentai.org/g/1375385/03519d541b/
|
// Example JP gallery: https://exhentai.org/g/1375385/03519d541b/
|
||||||
|
@ -58,7 +58,7 @@ class Hitomi(delegate: HttpSource, val context: Context) :
|
|||||||
|
|
||||||
input.select(".gallery-info tr").forEach { galleryInfoElement ->
|
input.select(".gallery-info tr").forEach { galleryInfoElement ->
|
||||||
val content = galleryInfoElement.child(1)
|
val content = galleryInfoElement.child(1)
|
||||||
when (galleryInfoElement.child(0).text().toLowerCase()) {
|
when (galleryInfoElement.child(0).text().lowercase()) {
|
||||||
"group" -> {
|
"group" -> {
|
||||||
group = content.text()
|
group = content.text()
|
||||||
tags += RaisedTag("group", group!!, RaisedSearchMetadata.TAG_TYPE_VIRTUAL)
|
tags += RaisedTag("group", group!!, RaisedSearchMetadata.TAG_TYPE_VIRTUAL)
|
||||||
@ -114,7 +114,7 @@ class Hitomi(delegate: HttpSource, val context: Context) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun toString() = "$name (${lang.toUpperCase()})"
|
override fun toString() = "$name (${lang.uppercase()})"
|
||||||
|
|
||||||
override fun ensureDelegateCompatible() {
|
override fun ensureDelegateCompatible() {
|
||||||
if (versionId != delegate.versionId) {
|
if (versionId != delegate.versionId) {
|
||||||
@ -127,7 +127,7 @@ class Hitomi(delegate: HttpSource, val context: Context) :
|
|||||||
)
|
)
|
||||||
|
|
||||||
override suspend fun mapUrlToMangaUrl(uri: Uri): String? {
|
override suspend fun mapUrlToMangaUrl(uri: Uri): String? {
|
||||||
val lcFirstPathSegment = uri.pathSegments.firstOrNull()?.toLowerCase() ?: return null
|
val lcFirstPathSegment = uri.pathSegments.firstOrNull()?.lowercase() ?: return null
|
||||||
|
|
||||||
if (lcFirstPathSegment != "manga" && lcFirstPathSegment != "reader") {
|
if (lcFirstPathSegment != "manga" && lcFirstPathSegment != "reader") {
|
||||||
return null
|
return null
|
||||||
|
@ -148,7 +148,7 @@ class NHentai(delegate: HttpSource, val context: Context) :
|
|||||||
val count: Long? = null
|
val count: Long? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun toString() = "$name (${lang.toUpperCase()})"
|
override fun toString() = "$name (${lang.uppercase()})"
|
||||||
|
|
||||||
override fun ensureDelegateCompatible() {
|
override fun ensureDelegateCompatible() {
|
||||||
if (versionId != delegate.versionId) {
|
if (versionId != delegate.versionId) {
|
||||||
@ -161,7 +161,7 @@ class NHentai(delegate: HttpSource, val context: Context) :
|
|||||||
)
|
)
|
||||||
|
|
||||||
override suspend fun mapUrlToMangaUrl(uri: Uri): String? {
|
override suspend fun mapUrlToMangaUrl(uri: Uri): String? {
|
||||||
if (uri.pathSegments.firstOrNull()?.toLowerCase() != "g") {
|
if (uri.pathSegments.firstOrNull()?.lowercase() != "g") {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,14 +58,14 @@ class PervEden(delegate: HttpSource, val context: Context) :
|
|||||||
tags.clear()
|
tags.clear()
|
||||||
var inStatus: String? = null
|
var inStatus: String? = null
|
||||||
rightBoxElement.childNodes().forEach {
|
rightBoxElement.childNodes().forEach {
|
||||||
if (it is Element && it.tagName().toLowerCase() == "h4") {
|
if (it is Element && it.tagName().lowercase() == "h4") {
|
||||||
inStatus = it.text().trim()
|
inStatus = it.text().trim()
|
||||||
} else {
|
} else {
|
||||||
when (inStatus) {
|
when (inStatus) {
|
||||||
"Alternative name(s)" -> {
|
"Alternative name(s)" -> {
|
||||||
if (it is TextNode) {
|
if (it is TextNode) {
|
||||||
val text = it.text().trim()
|
val text = it.text().trim()
|
||||||
if (!text.isBlank()) {
|
if (text.isNotBlank()) {
|
||||||
newAltTitles += text
|
newAltTitles += text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,7 +75,7 @@ class PervEden(delegate: HttpSource, val context: Context) :
|
|||||||
artist = it.text()
|
artist = it.text()
|
||||||
tags += RaisedTag(
|
tags += RaisedTag(
|
||||||
"artist",
|
"artist",
|
||||||
it.text().toLowerCase(),
|
it.text().lowercase(),
|
||||||
RaisedSearchMetadata.TAG_TYPE_VIRTUAL
|
RaisedSearchMetadata.TAG_TYPE_VIRTUAL
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ class PervEden(delegate: HttpSource, val context: Context) :
|
|||||||
if (it is Element && it.tagName() == "a") {
|
if (it is Element && it.tagName() == "a") {
|
||||||
tags += RaisedTag(
|
tags += RaisedTag(
|
||||||
null,
|
null,
|
||||||
it.text().toLowerCase(),
|
it.text().lowercase(),
|
||||||
PervEdenSearchMetadata.TAG_TYPE_DEFAULT
|
PervEdenSearchMetadata.TAG_TYPE_DEFAULT
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ class PervEden(delegate: HttpSource, val context: Context) :
|
|||||||
"Type" -> {
|
"Type" -> {
|
||||||
if (it is TextNode) {
|
if (it is TextNode) {
|
||||||
val text = it.text().trim()
|
val text = it.text().trim()
|
||||||
if (!text.isBlank()) {
|
if (text.isNotBlank()) {
|
||||||
genre = text
|
genre = text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -100,7 +100,7 @@ class PervEden(delegate: HttpSource, val context: Context) :
|
|||||||
"Status" -> {
|
"Status" -> {
|
||||||
if (it is TextNode) {
|
if (it is TextNode) {
|
||||||
val text = it.text().trim()
|
val text = it.text().trim()
|
||||||
if (!text.isBlank()) {
|
if (text.isNotBlank()) {
|
||||||
status = text
|
status = text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ class PervEden(delegate: HttpSource, val context: Context) :
|
|||||||
override val matchingHosts = listOf("www.perveden.com")
|
override val matchingHosts = listOf("www.perveden.com")
|
||||||
|
|
||||||
override fun matchesUri(uri: Uri): Boolean {
|
override fun matchesUri(uri: Uri): Boolean {
|
||||||
return super.matchesUri(uri) && uri.pathSegments.firstOrNull()?.toLowerCase() == when (lang) {
|
return super.matchesUri(uri) && uri.pathSegments.firstOrNull()?.lowercase() == when (lang) {
|
||||||
"en" -> "en-manga"
|
"en" -> "en-manga"
|
||||||
"it" -> "it-manga"
|
"it" -> "it-manga"
|
||||||
else -> false
|
else -> false
|
||||||
|
@ -91,7 +91,7 @@ class EightMuses(delegate: HttpSource, val context: Context) :
|
|||||||
|
|
||||||
override suspend fun mapUrlToMangaUrl(uri: Uri): String {
|
override suspend fun mapUrlToMangaUrl(uri: Uri): String {
|
||||||
var path = uri.pathSegments.drop(2)
|
var path = uri.pathSegments.drop(2)
|
||||||
if (uri.pathSegments[1].toLowerCase() == "picture") {
|
if (uri.pathSegments[1].lowercase() == "picture") {
|
||||||
path = path.dropLast(1)
|
path = path.dropLast(1)
|
||||||
}
|
}
|
||||||
return "/comics/album/${path.joinToString("/")}"
|
return "/comics/album/${path.joinToString("/")}"
|
||||||
|
@ -48,7 +48,7 @@ class HBrowse(delegate: HttpSource, val context: Context) :
|
|||||||
|
|
||||||
tags.clear()
|
tags.clear()
|
||||||
((tables[""] ?: error("")) + (tables["categories"] ?: error(""))).forEach { (k, v) ->
|
((tables[""] ?: error("")) + (tables["categories"] ?: error(""))).forEach { (k, v) ->
|
||||||
when (val lowercaseNs = k.toLowerCase()) {
|
when (val lowercaseNs = k.lowercase()) {
|
||||||
"title" -> title = v.text()
|
"title" -> title = v.text()
|
||||||
"length" -> length = v.text().substringBefore(" ").toInt()
|
"length" -> length = v.text().substringBefore(" ").toInt()
|
||||||
else -> {
|
else -> {
|
||||||
@ -67,7 +67,7 @@ class HBrowse(delegate: HttpSource, val context: Context) :
|
|||||||
|
|
||||||
private fun parseIntoTables(doc: Document): Map<String, Map<String, Element>> {
|
private fun parseIntoTables(doc: Document): Map<String, Map<String, Element>> {
|
||||||
return doc.select("#main > .listTable").map { ele ->
|
return doc.select("#main > .listTable").map { ele ->
|
||||||
val tableName = ele.previousElementSibling()?.text()?.toLowerCase().orEmpty()
|
val tableName = ele.previousElementSibling()?.text()?.lowercase().orEmpty()
|
||||||
tableName to ele.select("tr").map {
|
tableName to ele.select("tr").map {
|
||||||
it.child(0).text() to it.child(1)
|
it.child(0).text() to it.child(1)
|
||||||
}.toMap()
|
}.toMap()
|
||||||
|
@ -73,7 +73,7 @@ class Pururin(delegate: HttpSource, val context: Context) :
|
|||||||
|
|
||||||
tags.clear()
|
tags.clear()
|
||||||
contentWrapper.select(".table-gallery-info > tbody > tr").forEach { ele ->
|
contentWrapper.select(".table-gallery-info > tbody > tr").forEach { ele ->
|
||||||
val key = ele.child(0).text().toLowerCase()
|
val key = ele.child(0).text().lowercase()
|
||||||
val value = ele.child(1)
|
val value = ele.child(1)
|
||||||
when (key) {
|
when (key) {
|
||||||
"pages" -> {
|
"pages" -> {
|
||||||
|
@ -42,7 +42,7 @@ class Tsumino(delegate: HttpSource, val context: Context) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun mapUrlToMangaUrl(uri: Uri): String? {
|
override suspend fun mapUrlToMangaUrl(uri: Uri): String? {
|
||||||
val lcFirstPathSegment = uri.pathSegments.firstOrNull()?.toLowerCase(Locale.ROOT) ?: return null
|
val lcFirstPathSegment = uri.pathSegments.firstOrNull()?.lowercase(Locale.ROOT) ?: return null
|
||||||
if (lcFirstPathSegment != "read" && lcFirstPathSegment != "book" && lcFirstPathSegment != "entry") {
|
if (lcFirstPathSegment != "read" && lcFirstPathSegment != "book" && lcFirstPathSegment != "entry") {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,6 @@ class MigrationMangaDialog<T>(bundle: Bundle? = null) : DialogController(bundle)
|
|||||||
(targetController as? MigrationListController)?.migrateMangas()
|
(targetController as? MigrationListController)?.migrateMangas()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.negativeButton(android.R.string.no)
|
.negativeButton(android.R.string.cancel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ class SourceController(bundle: Bundle? = null) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun addToCategories(source: Source) {
|
private fun addToCategories(source: Source) {
|
||||||
val categories = preferences.sourcesTabCategories().get().toList().sortedBy { it.toLowerCase() }
|
val categories = preferences.sourcesTabCategories().get().toList().sortedBy { it.lowercase() }
|
||||||
|
|
||||||
if (categories.isEmpty()) {
|
if (categories.isEmpty()) {
|
||||||
applicationContext?.toast(R.string.no_source_categories)
|
applicationContext?.toast(R.string.no_source_categories)
|
||||||
|
@ -219,7 +219,7 @@ class SourceFilterController : SettingsController() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun sortedSources(sources: List<HttpSource>?): List<HttpSource> {
|
private fun sortedSources(sources: List<HttpSource>?): List<HttpSource> {
|
||||||
val sourceAlpha = sources.orEmpty().sortedBy { it.name.toLowerCase() }
|
val sourceAlpha = sources.orEmpty().sortedBy { it.name.lowercase() }
|
||||||
return if (sorting == SourcesSort.Enabled) {
|
return if (sorting == SourcesSort.Enabled) {
|
||||||
val disabledSourceIds = preferences.disabledSources().get()
|
val disabledSourceIds = preferences.disabledSources().get()
|
||||||
sourceAlpha.filter { it.id.toString() !in disabledSourceIds } +
|
sourceAlpha.filter { it.id.toString() !in disabledSourceIds } +
|
||||||
|
@ -278,7 +278,7 @@ open class BrowseSourceController(bundle: Bundle) :
|
|||||||
.title(R.string.save_search_delete)
|
.title(R.string.save_search_delete)
|
||||||
.message(text = it.getString(R.string.save_search_delete_message, search.name))
|
.message(text = it.getString(R.string.save_search_delete_message, search.name))
|
||||||
.positiveButton(R.string.action_cancel)
|
.positiveButton(R.string.action_cancel)
|
||||||
.negativeButton(android.R.string.yes) {
|
.negativeButton(android.R.string.ok) {
|
||||||
val newSearches = savedSearches.filterIndexed { index, _ ->
|
val newSearches = savedSearches.filterIndexed { index, _ ->
|
||||||
index != indexToDelete
|
index != indexToDelete
|
||||||
}
|
}
|
||||||
|
@ -85,10 +85,10 @@ class SourceEnhancedEHentaiListHolder(private val view: View, adapter: FlexibleA
|
|||||||
val pageCount = metadata.length
|
val pageCount = metadata.length
|
||||||
|
|
||||||
binding.language.text = if (locale != null && pageCount != null) {
|
binding.language.text = if (locale != null && pageCount != null) {
|
||||||
view.resources.getQuantityString(R.plurals.browse_language_and_pages, pageCount, pageCount, locale.toLanguageTag().toUpperCase())
|
view.resources.getQuantityString(R.plurals.browse_language_and_pages, pageCount, pageCount, locale.toLanguageTag().uppercase())
|
||||||
} else if (pageCount != null) {
|
} else if (pageCount != null) {
|
||||||
view.resources.getQuantityString(R.plurals.num_pages, pageCount, pageCount)
|
view.resources.getQuantityString(R.plurals.num_pages, pageCount, pageCount)
|
||||||
} else locale?.toLanguageTag()?.toUpperCase()
|
} else locale?.toLanguageTag()?.uppercase()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setImage(manga: Manga) {
|
override fun setImage(manga: Manga) {
|
||||||
|
@ -166,7 +166,7 @@ class SourceFilterSheet(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.sortedBy { it.text.toString().toLowerCase() }
|
.sortedBy { it.text.toString().lowercase() }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hideFilterButton() {
|
fun hideFilterButton() {
|
||||||
|
@ -30,7 +30,7 @@ class RepoPresenter(
|
|||||||
super.onCreate(savedState)
|
super.onCreate(savedState)
|
||||||
|
|
||||||
preferences.extensionRepos().asFlow().onEach { repos ->
|
preferences.extensionRepos().asFlow().onEach { repos ->
|
||||||
this.repos = repos.toList().sortedBy { it.toLowerCase() }
|
this.repos = repos.toList().sortedBy { it.lowercase() }
|
||||||
|
|
||||||
Observable.just(this.repos)
|
Observable.just(this.repos)
|
||||||
.map { it.map(::RepoItem) }
|
.map { it.map(::RepoItem) }
|
||||||
|
@ -34,7 +34,7 @@ class SourceCategoryPresenter(
|
|||||||
super.onCreate(savedState)
|
super.onCreate(savedState)
|
||||||
|
|
||||||
preferences.sourcesTabCategories().asFlow().onEach { categories ->
|
preferences.sourcesTabCategories().asFlow().onEach { categories ->
|
||||||
this.categories = categories.toList().sortedBy { it.toLowerCase() }
|
this.categories = categories.toList().sortedBy { it.lowercase() }
|
||||||
|
|
||||||
Observable.just(this.categories)
|
Observable.just(this.categories)
|
||||||
.map { it.map(::SourceCategoryItem) }
|
.map { it.map(::SourceCategoryItem) }
|
||||||
|
@ -809,7 +809,7 @@ class LibraryPresenter(
|
|||||||
|
|
||||||
val categories = (
|
val categories = (
|
||||||
when (groupType) {
|
when (groupType) {
|
||||||
LibraryGroup.BY_SOURCE -> grouping.sortedBy { it.third.toLowerCase() }
|
LibraryGroup.BY_SOURCE -> grouping.sortedBy { it.third.lowercase() }
|
||||||
LibraryGroup.BY_TRACK_STATUS, LibraryGroup.BY_STATUS -> grouping.filter { it.second in map.keys }
|
LibraryGroup.BY_TRACK_STATUS, LibraryGroup.BY_STATUS -> grouping.filter { it.second in map.keys }
|
||||||
else -> grouping
|
else -> grouping
|
||||||
}
|
}
|
||||||
|
@ -545,7 +545,7 @@ class SettingsEhController : SettingsController() {
|
|||||||
MaterialDialog(activity)
|
MaterialDialog(activity)
|
||||||
.title(R.string.favorites_sync_reset)
|
.title(R.string.favorites_sync_reset)
|
||||||
.message(R.string.favorites_sync_reset_message)
|
.message(R.string.favorites_sync_reset_message)
|
||||||
.positiveButton(android.R.string.yes) {
|
.positiveButton(android.R.string.ok) {
|
||||||
LocalFavoritesStorage().apply {
|
LocalFavoritesStorage().apply {
|
||||||
getRealm().use {
|
getRealm().use {
|
||||||
it.trans {
|
it.trans {
|
||||||
@ -555,7 +555,7 @@ class SettingsEhController : SettingsController() {
|
|||||||
}
|
}
|
||||||
activity.toast(context.getString(R.string.sync_state_reset), Toast.LENGTH_LONG)
|
activity.toast(context.getString(R.string.sync_state_reset), Toast.LENGTH_LONG)
|
||||||
}
|
}
|
||||||
.negativeButton(android.R.string.no)
|
.negativeButton(android.R.string.cancel)
|
||||||
.cancelable(false)
|
.cancelable(false)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
@ -170,22 +170,22 @@ object DebugFunctions {
|
|||||||
fun clearSavedSearches() = prefs.savedSearches().set(emptySet())
|
fun clearSavedSearches() = prefs.savedSearches().set(emptySet())
|
||||||
|
|
||||||
fun listAllSources() = sourceManager.getCatalogueSources().joinToString("\n") {
|
fun listAllSources() = sourceManager.getCatalogueSources().joinToString("\n") {
|
||||||
"${it.id}: ${it.name} (${it.lang.toUpperCase()})"
|
"${it.id}: ${it.name} (${it.lang.uppercase()})"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun listAllSourcesClassName() = sourceManager.getCatalogueSources().joinToString("\n") {
|
fun listAllSourcesClassName() = sourceManager.getCatalogueSources().joinToString("\n") {
|
||||||
"${it::class.qualifiedName}: ${it.name} (${it.lang.toUpperCase()})"
|
"${it::class.qualifiedName}: ${it.name} (${it.lang.uppercase()})"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun listVisibleSources() = sourceManager.getVisibleCatalogueSources().joinToString("\n") {
|
fun listVisibleSources() = sourceManager.getVisibleCatalogueSources().joinToString("\n") {
|
||||||
"${it.id}: ${it.name} (${it.lang.toUpperCase()})"
|
"${it.id}: ${it.name} (${it.lang.uppercase()})"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun listAllHttpSources() = sourceManager.getOnlineSources().joinToString("\n") {
|
fun listAllHttpSources() = sourceManager.getOnlineSources().joinToString("\n") {
|
||||||
"${it.id}: ${it.name} (${it.lang.toUpperCase()})"
|
"${it.id}: ${it.name} (${it.lang.uppercase()})"
|
||||||
}
|
}
|
||||||
fun listVisibleHttpSources() = sourceManager.getVisibleOnlineSources().joinToString("\n") {
|
fun listVisibleHttpSources() = sourceManager.getVisibleOnlineSources().joinToString("\n") {
|
||||||
"${it.id}: ${it.name} (${it.lang.toUpperCase()})"
|
"${it.id}: ${it.name} (${it.lang.uppercase()})"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun convertAllEhentaiGalleriesToExhentai() = convertSources(EH_SOURCE_ID, EXH_SOURCE_ID)
|
fun convertAllEhentaiGalleriesToExhentai() = convertSources(EH_SOURCE_ID, EXH_SOURCE_ID)
|
||||||
|
@ -31,7 +31,7 @@ class SettingsDebugController : SettingsController() {
|
|||||||
it.visibility == KVisibility.PUBLIC
|
it.visibility == KVisibility.PUBLIC
|
||||||
}.forEach {
|
}.forEach {
|
||||||
preference {
|
preference {
|
||||||
title = it.name.replace("(.)(\\p{Upper})".toRegex(), "$1 $2").toLowerCase(Locale.getDefault()).capitalize(Locale.getDefault())
|
title = it.name.replace("(.)(\\p{Upper})".toRegex(), "$1 $2").lowercase(Locale.getDefault()).capitalize(Locale.getDefault())
|
||||||
isPersistent = false
|
isPersistent = false
|
||||||
|
|
||||||
onClick {
|
onClick {
|
||||||
@ -62,7 +62,7 @@ class SettingsDebugController : SettingsController() {
|
|||||||
|
|
||||||
DebugToggles.values().forEach {
|
DebugToggles.values().forEach {
|
||||||
switchPreference {
|
switchPreference {
|
||||||
title = it.name.replace('_', ' ').toLowerCase(Locale.getDefault()).capitalize(Locale.getDefault())
|
title = it.name.replace('_', ' ').lowercase(Locale.getDefault()).capitalize(Locale.getDefault())
|
||||||
key = it.prefKey
|
key = it.prefKey
|
||||||
defaultValue = it.default
|
defaultValue = it.default
|
||||||
summaryOn = if (it.default) "" else MODIFIED_TEXT
|
summaryOn = if (it.default) "" else MODIFIED_TEXT
|
||||||
|
@ -62,7 +62,7 @@ class EHDebugModeOverlay(private val context: Context) : OverlayModule<String>(n
|
|||||||
<b>Debug mode:</b> ${BuildConfig.DEBUG.asEnabledString()}<br>
|
<b>Debug mode:</b> ${BuildConfig.DEBUG.asEnabledString()}<br>
|
||||||
<b>Version code:</b> ${BuildConfig.VERSION_CODE}<br>
|
<b>Version code:</b> ${BuildConfig.VERSION_CODE}<br>
|
||||||
<b>Commit SHA:</b> ${BuildConfig.COMMIT_SHA}<br>
|
<b>Commit SHA:</b> ${BuildConfig.COMMIT_SHA}<br>
|
||||||
<b>Log level:</b> ${EHLogLevel.currentLogLevel.name.toLowerCase(Locale.getDefault())}<br>
|
<b>Log level:</b> ${EHLogLevel.currentLogLevel.name.lowercase(Locale.getDefault())}<br>
|
||||||
<b>Source blacklist:</b> ${preferences.enableSourceBlacklist().get().asEnabledString()}
|
<b>Source blacklist:</b> ${preferences.enableSourceBlacklist().get().asEnabledString()}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ class FilterHandler(private val preferencesHelper: PreferencesHelper) {
|
|||||||
if (rating.state) {
|
if (rating.state) {
|
||||||
addQueryParameter(
|
addQueryParameter(
|
||||||
"contentRating[]",
|
"contentRating[]",
|
||||||
rating.name.toLowerCase(Locale.US)
|
rating.name.lowercase(Locale.US)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -203,7 +203,7 @@ class FilterHandler(private val preferencesHelper: PreferencesHelper) {
|
|||||||
if (demographic.state) {
|
if (demographic.state) {
|
||||||
addQueryParameter(
|
addQueryParameter(
|
||||||
"publicationDemographic[]",
|
"publicationDemographic[]",
|
||||||
demographic.name.toLowerCase(
|
demographic.name.lowercase(
|
||||||
Locale.US
|
Locale.US
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -215,7 +215,7 @@ class FilterHandler(private val preferencesHelper: PreferencesHelper) {
|
|||||||
if (status.state) {
|
if (status.state) {
|
||||||
addQueryParameter(
|
addQueryParameter(
|
||||||
"status[]",
|
"status[]",
|
||||||
status.name.toLowerCase(
|
status.name.lowercase(
|
||||||
Locale.US
|
Locale.US
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -246,13 +246,13 @@ class FilterHandler(private val preferencesHelper: PreferencesHelper) {
|
|||||||
is TagInclusionMode -> {
|
is TagInclusionMode -> {
|
||||||
addQueryParameter(
|
addQueryParameter(
|
||||||
"includedTagsMode",
|
"includedTagsMode",
|
||||||
filter.values[filter.state].toUpperCase(Locale.US)
|
filter.values[filter.state].uppercase(Locale.US)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
is TagExclusionMode -> {
|
is TagExclusionMode -> {
|
||||||
addQueryParameter(
|
addQueryParameter(
|
||||||
"excludedTagsMode",
|
"excludedTagsMode",
|
||||||
filter.values[filter.state].toUpperCase(Locale.US)
|
filter.values[filter.state].uppercase(Locale.US)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ class FollowsHandler(
|
|||||||
return withIOContext {
|
return withIOContext {
|
||||||
val status = when (followStatus == FollowStatus.UNFOLLOWED) {
|
val status = when (followStatus == FollowStatus.UNFOLLOWED) {
|
||||||
true -> null
|
true -> null
|
||||||
false -> followStatus.name.toLowerCase(Locale.US)
|
false -> followStatus.name.lowercase(Locale.US)
|
||||||
}
|
}
|
||||||
|
|
||||||
val jsonString = MdUtil.jsonParser.encodeToString(UpdateReadingStatus(status))
|
val jsonString = MdUtil.jsonParser.encodeToString(UpdateReadingStatus(status))
|
||||||
@ -247,7 +247,7 @@ class FollowsHandler(
|
|||||||
val mangaStatusUrl = MdUtil.mangaStatus.toHttpUrl().newBuilder()
|
val mangaStatusUrl = MdUtil.mangaStatus.toHttpUrl().newBuilder()
|
||||||
|
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
mangaStatusUrl.addQueryParameter("status", status.name.toLowerCase(Locale.US))
|
mangaStatusUrl.addQueryParameter("status", status.name.lowercase(Locale.US))
|
||||||
}
|
}
|
||||||
|
|
||||||
return GET(mangaStatusUrl.build().toString(), MdUtil.getAuthHeaders(headers, preferences, mdList), CacheControl.FORCE_NETWORK)
|
return GET(mangaStatusUrl.build().toString(), MdUtil.getAuthHeaders(headers, preferences, mdList), CacheControl.FORCE_NETWORK)
|
||||||
|
@ -12,7 +12,7 @@ enum class FollowStatus(val int: Int) {
|
|||||||
RE_READING(6);
|
RE_READING(6);
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun fromDex(value: String?): FollowStatus = values().firstOrNull { it.name.toLowerCase(Locale.US) == value } ?: UNFOLLOWED
|
fun fromDex(value: String?): FollowStatus = values().firstOrNull { it.name.lowercase(Locale.US) == value } ?: UNFOLLOWED
|
||||||
fun fromInt(value: Int): FollowStatus = values().firstOrNull { it.int == value } ?: UNFOLLOWED
|
fun fromInt(value: Int): FollowStatus = values().firstOrNull { it.int == value } ?: UNFOLLOWED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ class SearchEngine {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query.toLowerCase(Locale.getDefault()).forEach { char ->
|
query.lowercase(Locale.getDefault()).forEach { char ->
|
||||||
if (char == '"') {
|
if (char == '"') {
|
||||||
inQuotes = !inQuotes
|
inQuotes = !inQuotes
|
||||||
} else if (enableWildcard && (char == '?' || char == '_')) {
|
} else if (enableWildcard && (char == '?' || char == '_')) {
|
||||||
|
@ -99,7 +99,7 @@ class SmartSearchEngine(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun cleanSmartSearchTitle(title: String): String {
|
private fun cleanSmartSearchTitle(title: String): String {
|
||||||
val preTitle = title.toLowerCase(Locale.getDefault())
|
val preTitle = title.lowercase(Locale.getDefault())
|
||||||
|
|
||||||
// Remove text in brackets
|
// Remove text in brackets
|
||||||
var cleanedTitle = removeTextInBrackets(preTitle, true)
|
var cleanedTitle = removeTextInBrackets(preTitle, true)
|
||||||
|
@ -65,7 +65,7 @@ class EHConfigurator(val context: Context) {
|
|||||||
val hathPerks = EHHathPerksResponse()
|
val hathPerks = EHHathPerksResponse()
|
||||||
|
|
||||||
perksPage.select(".stuffbox tr").forEach {
|
perksPage.select(".stuffbox tr").forEach {
|
||||||
val name = it.child(0).text().toLowerCase(Locale.getDefault())
|
val name = it.child(0).text().lowercase(Locale.getDefault())
|
||||||
val purchased = it.child(2).getElementsByTag("form").isEmpty()
|
val purchased = it.child(2).getElementsByTag("form").isEmpty()
|
||||||
|
|
||||||
when (name) {
|
when (name) {
|
||||||
|
@ -14,7 +14,7 @@ class EhUConfigBuilder {
|
|||||||
configItems += when (
|
configItems += when (
|
||||||
preferences.imageQuality()
|
preferences.imageQuality()
|
||||||
.get()
|
.get()
|
||||||
.toLowerCase(Locale.getDefault())
|
.lowercase(Locale.getDefault())
|
||||||
) {
|
) {
|
||||||
"ovrs_2400" -> Entry.ImageSize.`2400`
|
"ovrs_2400" -> Entry.ImageSize.`2400`
|
||||||
"ovrs_1600" -> Entry.ImageSize.`1600`
|
"ovrs_1600" -> Entry.ImageSize.`1600`
|
||||||
|
@ -233,7 +233,7 @@ class EhLoginActivity : BaseViewBindingActivity<EhActivityLoginBinding>() {
|
|||||||
var igneous: String? = null
|
var igneous: String? = null
|
||||||
|
|
||||||
parsed.forEach {
|
parsed.forEach {
|
||||||
when (it.name.toLowerCase(Locale.getDefault())) {
|
when (it.name.lowercase(Locale.getDefault())) {
|
||||||
MEMBER_ID_COOKIE -> memberId = it.value
|
MEMBER_ID_COOKIE -> memberId = it.value
|
||||||
PASS_HASH_COOKIE -> passHash = it.value
|
PASS_HASH_COOKIE -> passHash = it.value
|
||||||
IGNEOUS_COOKIE -> igneous = this.igneous ?: it.value
|
IGNEOUS_COOKIE -> igneous = this.igneous ?: it.value
|
||||||
|
@ -18,7 +18,7 @@ fun Manga.mangaType(context: Context): String {
|
|||||||
MangaType.TYPE_COMIC -> R.string.comic
|
MangaType.TYPE_COMIC -> R.string.comic
|
||||||
else -> R.string.manga
|
else -> R.string.manga
|
||||||
}
|
}
|
||||||
).toLowerCase(Locale.getDefault())
|
).lowercase(Locale.getDefault())
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user