Add Pijamalı Koi (#3973)

* Add Pijamalı Koi

* Remove extra path segment unconditionally

Co-authored-by: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com>

---------

Co-authored-by: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com>
This commit is contained in:
Vetle Ledaal 2024-07-13 08:11:13 +02:00 committed by Draff
parent 3862f49ad7
commit 33afc95944
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
7 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,10 @@
ext {
extName = 'Pijamalı Koi'
extClass = '.PijamaliKoi'
themePkg = 'mangathemesia'
baseUrl = 'https://pijamalikoi.com/m'
overrideVersionCode = 0
isNsfw = false
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -0,0 +1,37 @@
package eu.kanade.tachiyomi.extension.tr.pijamalikoi
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import okhttp3.Request
import java.text.SimpleDateFormat
import java.util.Locale
class PijamaliKoi : MangaThemesia(
"Pijamalı Koi",
"https://pijamalikoi.com/m",
"tr",
mangaUrlDirectory = "/seri",
dateFormat = SimpleDateFormat("MMMM d, yyyy", Locale("tr")),
) {
override fun chapterListRequest(manga: SManga): Request {
return super.chapterListRequest(manga).fixupUrl()
}
override fun mangaDetailsRequest(manga: SManga): Request {
return super.mangaDetailsRequest(manga).fixupUrl()
}
override fun pageListRequest(chapter: SChapter): Request {
return super.pageListRequest(chapter).fixupUrl()
}
// Fixes the extra `/m` in the manga URL
//
// In the database URLs are stored as `/m/seri/regina-rena-to-the-unforgiven/`
// With `*Request()` it becomes `$baseUrl/m/seri/regina-rena-to-the-unforgiven/`
// Since `baseUrl` contains the the extra `/m`, it will double up, leading to an invalid URL.
private fun Request.fixupUrl(): Request {
return newBuilder().url(url.newBuilder().removePathSegment(0).build()).build()
}
}