diff --git a/lib-multisrc/fansubscat/build.gradle.kts b/lib-multisrc/fansubscat/build.gradle.kts index 6e70fd158..b45873b53 100644 --- a/lib-multisrc/fansubscat/build.gradle.kts +++ b/lib-multisrc/fansubscat/build.gradle.kts @@ -2,4 +2,4 @@ plugins { id("lib-multisrc") } -baseVersionCode = 4 +baseVersionCode = 5 diff --git a/lib-multisrc/fansubscat/src/eu/kanade/tachiyomi/multisrc/fansubscat/FansubsCat.kt b/lib-multisrc/fansubscat/src/eu/kanade/tachiyomi/multisrc/fansubscat/FansubsCat.kt index 4a4012cd1..feee849e4 100644 --- a/lib-multisrc/fansubscat/src/eu/kanade/tachiyomi/multisrc/fansubscat/FansubsCat.kt +++ b/lib-multisrc/fansubscat/src/eu/kanade/tachiyomi/multisrc/fansubscat/FansubsCat.kt @@ -30,11 +30,10 @@ abstract class FansubsCat( override val name: String, override val baseUrl: String, override val lang: String, + val apiBaseUrl: String, val isHentaiSite: Boolean, ) : HttpSource() { - private val apiBaseUrl = "https://api.fansubs.cat" - override val supportsLatest = true override fun headersBuilder(): Headers.Builder = Headers.Builder() @@ -91,7 +90,7 @@ abstract class FansubsCat( // Popular override fun popularMangaRequest(page: Int): Request { - return GET("$apiBaseUrl/manga/popular/$page?hentai=$isHentaiSite", headers) + return GET("$apiBaseUrl/manga/popular/$page", headers) } override fun popularMangaParse(response: Response): MangasPage = parseMangaFromJson(response) @@ -99,7 +98,7 @@ abstract class FansubsCat( // Latest override fun latestUpdatesRequest(page: Int): Request { - return GET("$apiBaseUrl/manga/recent/$page?hentai=$isHentaiSite", headers) + return GET("$apiBaseUrl/manga/recent/$page", headers) } override fun latestUpdatesParse(response: Response): MangasPage = parseMangaFromJson(response) @@ -110,13 +109,15 @@ abstract class FansubsCat( val filterList = if (filters.isEmpty()) getFilterList() else filters val mangaTypeFilter = filterList.find { it is MangaTypeFilter } as MangaTypeFilter val stateFilter = filterList.find { it is StateFilter } as StateFilter - val demographyFilter = filterList.find { it is DemographyFilter } as DemographyFilter val genreFilter = filterList.find { it is GenreTagFilter } as GenreTagFilter val themeFilter = filterList.find { it is ThemeTagFilter } as ThemeTagFilter - val builder = "$apiBaseUrl/manga/search/$page?hentai=$isHentaiSite".toHttpUrl().newBuilder() + val builder = "$apiBaseUrl/manga/search/$page".toHttpUrl().newBuilder() mangaTypeFilter.addQueryParameter(builder) stateFilter.addQueryParameter(builder) - demographyFilter.addQueryParameter(builder) + if (!isHentaiSite) { + val demographyFilter = filterList.find { it is DemographyFilter } as DemographyFilter + demographyFilter.addQueryParameter(builder) + } genreFilter.addQueryParameter(builder) themeFilter.addQueryParameter(builder) if (query.isNotBlank()) { @@ -131,7 +132,7 @@ abstract class FansubsCat( override fun mangaDetailsRequest(manga: SManga): Request { return GET( - "$apiBaseUrl/manga/details/${manga.url.substringAfterLast('/')}?hentai=$isHentaiSite", + "$apiBaseUrl/manga/details/${manga.url.substringAfterLast('/')}", headers, ) } @@ -166,7 +167,7 @@ abstract class FansubsCat( override fun chapterListRequest(manga: SManga): Request { return GET( - "$apiBaseUrl/manga/chapters/${manga.url.substringAfterLast('/')}?hentai=$isHentaiSite", + "$apiBaseUrl/manga/chapters/${manga.url.substringAfterLast('/')}", headers, ) } @@ -178,7 +179,7 @@ abstract class FansubsCat( override fun pageListRequest(chapter: SChapter): Request { return GET( - "$apiBaseUrl/manga/pages/${chapter.url.substringAfterLast('/')}?hentai=$isHentaiSite", + "$apiBaseUrl/manga/pages/${chapter.url.substringAfterLast('/')}", headers, ) } diff --git a/src/ca/fansubscat/build.gradle b/src/ca/fansubscat/build.gradle index b6089197e..e055b193f 100644 --- a/src/ca/fansubscat/build.gradle +++ b/src/ca/fansubscat/build.gradle @@ -1,6 +1,6 @@ ext { extName = 'Fansubs.cat' - extClass = '.FansubsCatMain' + extClass = '.FansubsCat' themePkg = 'fansubscat' baseUrl = 'https://manga.fansubs.cat' overrideVersionCode = 0 diff --git a/src/ca/fansubscat/res/mipmap-hdpi/ic_launcher.png b/src/ca/fansubscat/res/mipmap-hdpi/ic_launcher.png index 62a89997b..dc0a774c5 100644 Binary files a/src/ca/fansubscat/res/mipmap-hdpi/ic_launcher.png and b/src/ca/fansubscat/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/ca/fansubscat/res/mipmap-mdpi/ic_launcher.png b/src/ca/fansubscat/res/mipmap-mdpi/ic_launcher.png index 3ffb60b76..821023a95 100644 Binary files a/src/ca/fansubscat/res/mipmap-mdpi/ic_launcher.png and b/src/ca/fansubscat/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/ca/fansubscat/res/mipmap-xhdpi/ic_launcher.png b/src/ca/fansubscat/res/mipmap-xhdpi/ic_launcher.png index 515447115..af3b1f3a5 100644 Binary files a/src/ca/fansubscat/res/mipmap-xhdpi/ic_launcher.png and b/src/ca/fansubscat/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/ca/fansubscat/res/mipmap-xxhdpi/ic_launcher.png b/src/ca/fansubscat/res/mipmap-xxhdpi/ic_launcher.png index c550e843d..5548b00d3 100644 Binary files a/src/ca/fansubscat/res/mipmap-xxhdpi/ic_launcher.png and b/src/ca/fansubscat/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/ca/fansubscat/res/mipmap-xxxhdpi/ic_launcher.png b/src/ca/fansubscat/res/mipmap-xxxhdpi/ic_launcher.png index bb7d942e0..d0b7a4403 100644 Binary files a/src/ca/fansubscat/res/mipmap-xxxhdpi/ic_launcher.png and b/src/ca/fansubscat/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/ca/fansubscat/src/eu/kanade/tachiyomi/extension/ca/fansubscat/FansubsCatMain.kt b/src/ca/fansubscat/src/eu/kanade/tachiyomi/extension/ca/fansubscat/FansubsCat.kt similarity index 76% rename from src/ca/fansubscat/src/eu/kanade/tachiyomi/extension/ca/fansubscat/FansubsCatMain.kt rename to src/ca/fansubscat/src/eu/kanade/tachiyomi/extension/ca/fansubscat/FansubsCat.kt index abecc8907..54fcb47f8 100644 --- a/src/ca/fansubscat/src/eu/kanade/tachiyomi/extension/ca/fansubscat/FansubsCatMain.kt +++ b/src/ca/fansubscat/src/eu/kanade/tachiyomi/extension/ca/fansubscat/FansubsCat.kt @@ -2,9 +2,10 @@ package eu.kanade.tachiyomi.extension.ca.fansubscat import eu.kanade.tachiyomi.multisrc.fansubscat.FansubsCat -class FansubsCatMain : FansubsCat( +class FansubsCat : FansubsCat( "Fansubs.cat", "https://manga.fansubs.cat", "ca", + "https://api.fansubs.cat", isHentaiSite = false, ) diff --git a/src/ca/fansubscathentai/build.gradle b/src/ca/fansubscathentai/build.gradle index ee61e08f0..7a839e9c7 100644 --- a/src/ca/fansubscathentai/build.gradle +++ b/src/ca/fansubscathentai/build.gradle @@ -1,8 +1,8 @@ ext { - extName = 'Fansubs.cat - Hentai' - extClass = '.FansubsCatHentai' + extName = 'Hentai.cat' + extClass = '.HentaiCat' themePkg = 'fansubscat' - baseUrl = 'https://hentai.fansubs.cat/manga' + baseUrl = 'https://manga.hentai.cat' overrideVersionCode = 0 isNsfw = true } diff --git a/src/ca/fansubscathentai/res/mipmap-hdpi/ic_launcher.png b/src/ca/fansubscathentai/res/mipmap-hdpi/ic_launcher.png index 85c7cda14..68c702429 100644 Binary files a/src/ca/fansubscathentai/res/mipmap-hdpi/ic_launcher.png and b/src/ca/fansubscathentai/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/ca/fansubscathentai/res/mipmap-mdpi/ic_launcher.png b/src/ca/fansubscathentai/res/mipmap-mdpi/ic_launcher.png index 3f52697c4..ddb10da15 100644 Binary files a/src/ca/fansubscathentai/res/mipmap-mdpi/ic_launcher.png and b/src/ca/fansubscathentai/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/ca/fansubscathentai/res/mipmap-xhdpi/ic_launcher.png b/src/ca/fansubscathentai/res/mipmap-xhdpi/ic_launcher.png index 015a708e2..156c3f61f 100644 Binary files a/src/ca/fansubscathentai/res/mipmap-xhdpi/ic_launcher.png and b/src/ca/fansubscathentai/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/ca/fansubscathentai/res/mipmap-xxhdpi/ic_launcher.png b/src/ca/fansubscathentai/res/mipmap-xxhdpi/ic_launcher.png index 9d3a29b18..d2bc22a44 100644 Binary files a/src/ca/fansubscathentai/res/mipmap-xxhdpi/ic_launcher.png and b/src/ca/fansubscathentai/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/ca/fansubscathentai/res/mipmap-xxxhdpi/ic_launcher.png b/src/ca/fansubscathentai/res/mipmap-xxxhdpi/ic_launcher.png index e3fb8c336..70c2949de 100644 Binary files a/src/ca/fansubscathentai/res/mipmap-xxxhdpi/ic_launcher.png and b/src/ca/fansubscathentai/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/ca/fansubscathentai/src/eu/kanade/tachiyomi/extension/ca/fansubscathentai/FansubsCatHentai.kt b/src/ca/fansubscathentai/src/eu/kanade/tachiyomi/extension/ca/fansubscathentai/FansubsCatHentai.kt deleted file mode 100644 index 704e68942..000000000 --- a/src/ca/fansubscathentai/src/eu/kanade/tachiyomi/extension/ca/fansubscathentai/FansubsCatHentai.kt +++ /dev/null @@ -1,10 +0,0 @@ -package eu.kanade.tachiyomi.extension.ca.fansubscathentai - -import eu.kanade.tachiyomi.multisrc.fansubscat.FansubsCat - -class FansubsCatHentai : FansubsCat( - "Fansubs.cat - Hentai", - "https://hentai.fansubs.cat/manga", - "ca", - isHentaiSite = true, -) diff --git a/src/ca/fansubscathentai/src/eu/kanade/tachiyomi/extension/ca/fansubscathentai/HentaiCat.kt b/src/ca/fansubscathentai/src/eu/kanade/tachiyomi/extension/ca/fansubscathentai/HentaiCat.kt new file mode 100644 index 000000000..9713242b8 --- /dev/null +++ b/src/ca/fansubscathentai/src/eu/kanade/tachiyomi/extension/ca/fansubscathentai/HentaiCat.kt @@ -0,0 +1,13 @@ +package eu.kanade.tachiyomi.extension.ca.fansubscathentai + +import eu.kanade.tachiyomi.multisrc.fansubscat.FansubsCat + +class HentaiCat : FansubsCat( + "Hentai.cat", + "https://manga.hentai.cat", + "ca", + "https://api.hentai.cat", + isHentaiSite = true, +) { + override val id: Long = 7575385310756416449 +}