Update MS to their new domain (#17489)

Update MS to their new domain.
This commit is contained in:
Alessandro Jean 2023-08-11 17:25:54 -03:00 committed by GitHub
parent 8e11fd74dc
commit 96e8ea3094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

View File

@ -13,18 +13,23 @@ import java.util.Locale
class MiauScanFactory : SourceFactory { class MiauScanFactory : SourceFactory {
override fun createSources() = listOf( override fun createSources() = listOf(
MiauScan("es", Filter.TriState.STATE_EXCLUDE), MiauScan("es"),
MiauScan("pt-BR", Filter.TriState.STATE_INCLUDE), MiauScan("pt-BR"),
) )
} }
open class MiauScan(lang: String, private val portugueseMode: Int) : MangaThemesia( open class MiauScan(lang: String) : MangaThemesia(
name = "Miau Scan", name = "Miau Scan",
baseUrl = "https://miauscan.com", baseUrl = "https://miauscans.com",
lang = lang, lang = lang,
dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("es")), dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("es")),
) { ) {
private val portugueseMode =
if (lang == "pt-BR") Filter.TriState.STATE_INCLUDE else Filter.TriState.STATE_EXCLUDE
override val seriesGenreSelector = ".mgen a:not(:contains(Português))"
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val genreFilterIndex = filters.indexOfFirst { it is GenreListFilter } val genreFilterIndex = filters.indexOfFirst { it is GenreListFilter }
val genreFilter = filters.getOrNull(genreFilterIndex) as? GenreListFilter val genreFilter = filters.getOrNull(genreFilterIndex) as? GenreListFilter
@ -32,7 +37,7 @@ open class MiauScan(lang: String, private val portugueseMode: Int) : MangaThemes
val overloadedGenreFilter = GenreListFilter( val overloadedGenreFilter = GenreListFilter(
genres = genreFilter.state + listOf( genres = genreFilter.state + listOf(
Genre("", PORTUGUESE_GENRE, portugueseMode), Genre("", PORTUGUESE_GENRE_ID, portugueseMode),
), ),
) )
@ -60,11 +65,11 @@ open class MiauScan(lang: String, private val portugueseMode: Int) : MangaThemes
} }
override fun getGenreList(): List<Genre> { override fun getGenreList(): List<Genre> {
return super.getGenreList().filter { it.value != PORTUGUESE_GENRE } return super.getGenreList().filter { it.value != PORTUGUESE_GENRE_ID }
} }
companion object { companion object {
const val PORTUGUESE_GENRE = "307" const val PORTUGUESE_GENRE_ID = "307"
val PORTUGUESE_SUFFIX = "^\\(\\s*Portugu[êe]s\\s*\\)\\s*".toRegex(RegexOption.IGNORE_CASE) val PORTUGUESE_SUFFIX = "^\\(\\s*Portugu[êe]s\\s*\\)\\s*".toRegex(RegexOption.IGNORE_CASE)
} }

View File

@ -17,7 +17,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
MultiLang("Asura Scans", "https://asura.gg", listOf("en", "tr"), className = "AsuraScansFactory", pkgName = "asurascans", overrideVersionCode = 24), MultiLang("Asura Scans", "https://asura.gg", listOf("en", "tr"), className = "AsuraScansFactory", pkgName = "asurascans", overrideVersionCode = 24),
MultiLang("Flame Scans", "https://flamescans.org", listOf("en"), className = "FlameScansFactory", pkgName = "flamescans", overrideVersionCode = 4), MultiLang("Flame Scans", "https://flamescans.org", listOf("en"), className = "FlameScansFactory", pkgName = "flamescans", overrideVersionCode = 4),
MultiLang("Komik Lab", "https://komiklab.com", listOf("en", "id"), className = "KomikLabFactory", pkgName = "komiklab", overrideVersionCode = 2), MultiLang("Komik Lab", "https://komiklab.com", listOf("en", "id"), className = "KomikLabFactory", pkgName = "komiklab", overrideVersionCode = 2),
MultiLang("Miau Scan", "https://miauscan.com", listOf("es", "pt-BR")), MultiLang("Miau Scan", "https://miauscans.com", listOf("es", "pt-BR"), overrideVersionCode = 1),
SingleLang("Animated Glitched Scans", "https://anigliscans.com", "en"), SingleLang("Animated Glitched Scans", "https://anigliscans.com", "en"),
SingleLang("Arcane scan", "https://arcanescan.fr", "fr"), SingleLang("Arcane scan", "https://arcanescan.fr", "fr"),
SingleLang("Arena Scans", "https://arenascans.net", "en", overrideVersionCode = 1), SingleLang("Arena Scans", "https://arenascans.net", "en", overrideVersionCode = 1),