mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-06 10:47:25 +01:00
Minor cleanup to ResolvableSource
This commit is contained in:
parent
fcba2306e9
commit
7326598475
@ -5,29 +5,31 @@ import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
|
||||
/**
|
||||
* A source that may handle opening an SManga for a given URI.
|
||||
* A source that may handle opening an SManga or SChapter for a given URI.
|
||||
*
|
||||
* @since extensions-lib 1.5
|
||||
*/
|
||||
interface ResolvableSource : Source {
|
||||
|
||||
/**
|
||||
* Returns the UriType of the uri input.
|
||||
* Returns Unknown if unable to resolve the URI
|
||||
* Returns what the given URI may open.
|
||||
* Returns [UriType.Unknown] if the source is not able to resolve the URI.
|
||||
*
|
||||
* @since extensions-lib 1.5
|
||||
*/
|
||||
fun getUriType(uri: String): UriType
|
||||
|
||||
/**
|
||||
* Called if canHandleUri is true. Returns the corresponding SManga, if possible.
|
||||
* Called if [getUriType] is [UriType.Manga].
|
||||
* Returns the corresponding SManga, if possible.
|
||||
*
|
||||
* @since extensions-lib 1.5
|
||||
*/
|
||||
suspend fun getManga(uri: String): SManga?
|
||||
|
||||
/**
|
||||
* Called if canHandleUri is true. Returns the corresponding SChapter, if possible.
|
||||
* Called if [getUriType] is [UriType.Chapter].
|
||||
* Returns the corresponding SChapter, if possible.
|
||||
*
|
||||
* @since extensions-lib 1.5
|
||||
*/
|
||||
@ -35,7 +37,7 @@ interface ResolvableSource : Source {
|
||||
}
|
||||
|
||||
sealed interface UriType {
|
||||
object Manga : UriType
|
||||
object Chapter : UriType
|
||||
object Unknown : UriType
|
||||
data object Manga : UriType
|
||||
data object Chapter : UriType
|
||||
data object Unknown : UriType
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user