mirror of
https://github.com/tachiyomiorg/extensions-lib.git
synced 2024-11-26 05:04:18 +01:00
Add ResolvableSource interface
This commit is contained in:
parent
b107ef035e
commit
cb7470398e
@ -0,0 +1,27 @@
|
|||||||
|
package eu.kanade.tachiyomi.source.online
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.source.Source
|
||||||
|
import eu.kanade.tachiyomi.source.model.SManga
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A source that may handle opening an SManga for a given URI.
|
||||||
|
*
|
||||||
|
* @since extensions-lib 1.5
|
||||||
|
*/
|
||||||
|
@Suppress("unused")
|
||||||
|
interface ResolvableSource : Source {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether this source may potentially handle the given URI.
|
||||||
|
*
|
||||||
|
* @since extensions-lib 1.5
|
||||||
|
*/
|
||||||
|
fun canResolveUri(uri: String): Boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called if canHandleUri is true. Returns the corresponding SManga, if possible.
|
||||||
|
*
|
||||||
|
* @since extensions-lib 1.5
|
||||||
|
*/
|
||||||
|
suspend fun getManga(uri: String): SManga?
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user