From 7be52d2c4c16b4d92effc16cae5054191cd7d238 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Sat, 1 Oct 2022 23:02:26 +0600 Subject: [PATCH] Add methods to get manga and chapter url (#8) * Add methods to get manga and chapter url * Add since to javadoc --- .../tachiyomi/source/online/HttpSource.kt | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/online/HttpSource.kt b/library/src/main/java/eu/kanade/tachiyomi/source/online/HttpSource.kt index 8002e83..59f6d31 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/online/HttpSource.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/online/HttpSource.kt @@ -291,6 +291,28 @@ abstract class HttpSource : CatalogueSource { private fun getUrlWithoutDomain(orig: String): String { throw Exception("Stub!") } + + /** + * Returns the url of the provided manga + * + * @since extensions-lib 1.4 + * @param manga the manga + * @return url of the manga + */ + open fun getMangaUrl(manga: SManga): String { + throw Exception("Stub!") + } + + /** + * Returns the url of the provided chapter + * + * @since extensions-lib 1.4 + * @param chapter the chapter + * @return url of the chapter + */ + open fun getChapterUrl(chapter: SChapter): String { + throw Exception("Stub!") + } /** * Called before inserting a new chapter into database. Use it if you need to override chapter @@ -299,8 +321,7 @@ abstract class HttpSource : CatalogueSource { * @param chapter the chapter to be added. * @param manga the manga of the chapter. */ - open fun prepareNewChapter(chapter: SChapter, manga: SManga) { - } + open fun prepareNewChapter(chapter: SChapter, manga: SManga) {} /** * Returns the list of filters for the source.