Monochrome: update for extensions-lib 1.4 (#15341)

This commit is contained in:
ObserverOfTime 2023-02-13 12:34:11 +02:00 committed by GitHub
parent 9b4e5809fb
commit d43b2d2239
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -56,10 +56,6 @@ open class MonochromeCMS(
} }
} }
// Request the actual manga URL for the webview
override fun mangaDetailsRequest(manga: SManga) =
GET("$baseUrl/manga/${manga.url}", headers)
override fun fetchMangaDetails(manga: SManga) = override fun fetchMangaDetails(manga: SManga) =
Observable.just(manga.apply { initialized = true })!! Observable.just(manga.apply { initialized = true })!!
@ -87,6 +83,11 @@ open class MonochromeCMS(
return Observable.just(pages) return Observable.just(pages)
} }
override fun getMangaUrl(manga: SManga) = "$baseUrl/manga/${manga.url}"
override fun getChapterUrl(chapter: SChapter) =
"$baseUrl/chapters/${chapter.url.subSequence(37, 73)}"
private fun mangaFromAPI(manga: Manga) = private fun mangaFromAPI(manga: Manga) =
SManga.create().apply { SManga.create().apply {
url = manga.id url = manga.id
@ -111,6 +112,9 @@ open class MonochromeCMS(
override fun latestUpdatesRequest(page: Int) = override fun latestUpdatesRequest(page: Int) =
throw UnsupportedOperationException("Not used!") throw UnsupportedOperationException("Not used!")
override fun mangaDetailsRequest(manga: SManga) =
throw UnsupportedOperationException("Not used!")
override fun popularMangaParse(response: Response) = override fun popularMangaParse(response: Response) =
throw UnsupportedOperationException("Not used!") throw UnsupportedOperationException("Not used!")

View File

@ -8,7 +8,7 @@ class MonochromeGenerator : ThemeSourceGenerator {
override val themeClass = "MonochromeCMS" override val themeClass = "MonochromeCMS"
override val baseVersionCode = 3 override val baseVersionCode = 4
override val sources = listOf( override val sources = listOf(
SingleLang("Monochrome Scans", "https://manga.d34d.one", "en"), SingleLang("Monochrome Scans", "https://manga.d34d.one", "en"),