Skip to content

Commit

Permalink
Allow extensions to use both custom Related titles & App’s Related ti…
Browse files Browse the repository at this point in the history
…tles by search
  • Loading branch information
cuong-tran committed May 1, 2024
1 parent 52aa021 commit 70d5085
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,20 @@ abstract class HttpSource : CatalogueSource {
* @since komikku/extensions-lib 1.6
*/
protected open val supportsRelatedMangas: Boolean = false

/**
* Extensions provide custom [relatedMangaListRequest] and [relatedMangaListParse]
* while also want to use App's [getRelatedMangaListBySearch] together.
* @default false
* @since komikku/extensions-lib 1.6
*/
protected open val supportsRelatedMangasAndSearch: Boolean = false

/**
* Disable showing any related titles
* @default false
* @since komikku/extensions-lib 1.6
*/
protected open val disableRelatedMangas: Boolean = false

/**
Expand All @@ -187,6 +201,19 @@ abstract class HttpSource : CatalogueSource {
throw Exception("Stub!")
}

/**
* Fetch related mangas for a manga from source/site.
* Normally it's not needed to override this method.
*
* @since komikku/extensions-lib 1.6
* @param manga the current manga to get related mangas.
* @return the related mangas for the current manga.
* @throws UnsupportedOperationException if a source doesn't support related mangas.
*/
protected open suspend fun fetchRelatedMangaList(manga: SManga): List<SManga> {
throw Exception("Stub!")
}

/**
* Fetch related mangas by searching for each keywords from manga's title
*
Expand Down

0 comments on commit 70d5085

Please sign in to comment.