diff --git a/lib/extension/build.gradle b/lib/extension/build.gradle deleted file mode 100644 index 1dfdd8c83..000000000 --- a/lib/extension/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' - -android { - compileSdkVersion 27 - buildToolsVersion '29.0.2' - - defaultConfig { - minSdkVersion 16 - targetSdkVersion 27 - versionCode 1 - versionName '1.2' - } - - buildTypes { - release { - minifyEnabled false - } - } -} - -repositories { - mavenCentral() -} - -dependencies { - compileOnly 'com.squareup.okhttp3:okhttp:3.10.0' - compileOnly 'io.reactivex:rxjava:1.3.6' - compileOnly 'org.jsoup:jsoup:1.10.2' - compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" -} diff --git a/lib/extension/src/main/AndroidManifest.xml b/lib/extension/src/main/AndroidManifest.xml deleted file mode 100644 index f07f3a03d..000000000 --- a/lib/extension/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt deleted file mode 100644 index 17c64312b..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt +++ /dev/null @@ -1,11 +0,0 @@ -package eu.kanade.tachiyomi.network - -import android.content.Context -import okhttp3.OkHttpClient - -class NetworkHelper(context: Context) { - - val client: OkHttpClient = throw Exception("Stub!") - - val cloudflareClient: OkHttpClient = throw Exception("Stub!") -} \ No newline at end of file diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt deleted file mode 100644 index 455f45550..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt +++ /dev/null @@ -1,13 +0,0 @@ -package eu.kanade.tachiyomi.network - -import okhttp3.Call -import okhttp3.Response -import rx.Observable - -fun Call.asObservable(): Observable { - throw Exception("Stub!") -} - -fun Call.asObservableSuccess(): Observable { - throw Exception("Stub!") -} diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/network/Requests.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/network/Requests.kt deleted file mode 100644 index 642540ee7..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/network/Requests.kt +++ /dev/null @@ -1,25 +0,0 @@ -package eu.kanade.tachiyomi.network - -import okhttp3.CacheControl -import okhttp3.Headers -import okhttp3.Request -import okhttp3.RequestBody - -private val DEFAULT_CACHE_CONTROL: CacheControl = throw Exception("Stub!") -private val DEFAULT_HEADERS: Headers = throw Exception("Stub!") -private val DEFAULT_BODY: RequestBody = throw Exception("Stub!") - -fun GET(url: String, - headers: Headers = DEFAULT_HEADERS, - cache: CacheControl = DEFAULT_CACHE_CONTROL): Request { - - throw Exception("Stub!") -} - -fun POST(url: String, - headers: Headers = DEFAULT_HEADERS, - body: RequestBody = DEFAULT_BODY, - cache: CacheControl = DEFAULT_CACHE_CONTROL): Request { - - throw Exception("Stub!") -} diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/CatalogueSource.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/source/CatalogueSource.kt deleted file mode 100644 index f5f11a00b..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/CatalogueSource.kt +++ /dev/null @@ -1,46 +0,0 @@ -package eu.kanade.tachiyomi.source - -import eu.kanade.tachiyomi.source.model.FilterList -import eu.kanade.tachiyomi.source.model.MangasPage -import rx.Observable - -interface CatalogueSource : Source { - - /** - * An ISO 639-1 compliant language code (two letters in lower case). - */ - val lang: String - - /** - * Whether the source has support for latest updates. - */ - val supportsLatest: Boolean - - /** - * Returns an observable containing a page with a list of manga. - * - * @param page the page number to retrieve. - */ - fun fetchPopularManga(page: Int): Observable - - /** - * Returns an observable containing a page with a list of manga. - * - * @param page the page number to retrieve. - * @param query the search query. - * @param filters the list of filters to apply. - */ - fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable - - /** - * Returns an observable containing a page with a list of latest manga updates. - * - * @param page the page number to retrieve. - */ - fun fetchLatestUpdates(page: Int): Observable - - /** - * Returns the list of filters for the source. - */ - fun getFilterList(): FilterList -} \ No newline at end of file diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/Source.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/source/Source.kt deleted file mode 100644 index 7a5f43a84..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/Source.kt +++ /dev/null @@ -1,44 +0,0 @@ -package eu.kanade.tachiyomi.source - -import eu.kanade.tachiyomi.source.model.Page -import eu.kanade.tachiyomi.source.model.SChapter -import eu.kanade.tachiyomi.source.model.SManga -import rx.Observable - -/** - * A basic interface for creating a source. It could be an online source, a local source, etc... - */ -interface Source { - - /** - * Id for the source. Must be unique. - */ - val id: Long - - /** - * Name of the source. - */ - val name: String - - /** - * Returns an observable with the updated details for a manga. - * - * @param manga the manga to update. - */ - fun fetchMangaDetails(manga: SManga): Observable - - /** - * Returns an observable with all the available chapters for a manga. - * - * @param manga the manga to update. - */ - fun fetchChapterList(manga: SManga): Observable> - - /** - * Returns an observable with the list of pages a chapter has. - * - * @param chapter the chapter. - */ - fun fetchPageList(chapter: SChapter): Observable> - -} \ No newline at end of file diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/SourceFactory.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/source/SourceFactory.kt deleted file mode 100644 index d326c437a..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/SourceFactory.kt +++ /dev/null @@ -1,12 +0,0 @@ -package eu.kanade.tachiyomi.source - -/** - * A factory for creating sources at runtime. - */ -interface SourceFactory { - /** - * Create a new copy of the sources - * @return The created sources - */ - fun createSources(): List -} diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/Filter.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/Filter.kt deleted file mode 100644 index a65687802..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/Filter.kt +++ /dev/null @@ -1,27 +0,0 @@ -package eu.kanade.tachiyomi.source.model - -sealed class Filter(val name: String, var state: T) { - open class Header(name: String) : Filter(name, 0) - open class Separator(name: String = "") : Filter(name, 0) - abstract class Select(name: String, val values: Array, state: Int = 0) : Filter(name, state) - abstract class Text(name: String, state: String = "") : Filter(name, state) - abstract class CheckBox(name: String, state: Boolean = false) : Filter(name, state) - abstract class TriState(name: String, state: Int = STATE_IGNORE) : Filter(name, state) { - fun isIgnored() = state == STATE_IGNORE - fun isIncluded() = state == STATE_INCLUDE - fun isExcluded() = state == STATE_EXCLUDE - - companion object { - const val STATE_IGNORE = 0 - const val STATE_INCLUDE = 1 - const val STATE_EXCLUDE = 2 - } - } - abstract class Group(name: String, state: List): Filter>(name, state) - - abstract class Sort(name: String, val values: Array, state: Selection? = null) - : Filter(name, state) { - data class Selection(val index: Int, val ascending: Boolean) - } - -} \ No newline at end of file diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/FilterList.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/FilterList.kt deleted file mode 100644 index e24db65b6..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/FilterList.kt +++ /dev/null @@ -1,7 +0,0 @@ -package eu.kanade.tachiyomi.source.model - -data class FilterList(val list: List>) : List> by list { - - constructor(vararg fs: Filter<*>) : this(if (fs.isNotEmpty()) fs.asList() else emptyList()) - -} \ No newline at end of file diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/MangasPage.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/MangasPage.kt deleted file mode 100644 index 12dd172a7..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/MangasPage.kt +++ /dev/null @@ -1,3 +0,0 @@ -package eu.kanade.tachiyomi.source.model - -data class MangasPage(val mangas: List, val hasNextPage: Boolean) \ No newline at end of file diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/Page.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/Page.kt deleted file mode 100644 index 39715eb2a..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/Page.kt +++ /dev/null @@ -1,10 +0,0 @@ -package eu.kanade.tachiyomi.source.model - -import android.net.Uri - -class Page( - val index: Int, - val url: String = "", - var imageUrl: String? = null, - var uri: Uri? = null -) diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/SChapter.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/SChapter.kt deleted file mode 100644 index ca571b805..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/SChapter.kt +++ /dev/null @@ -1,21 +0,0 @@ -package eu.kanade.tachiyomi.source.model - -interface SChapter { - - var url: String - - var name: String - - var date_upload: Long - - var chapter_number: Float - - var scanlator: String? - - companion object { - fun create(): SChapter { - throw Exception("Stub!") - } - } - -} \ No newline at end of file diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/SManga.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/SManga.kt deleted file mode 100644 index 94f48725f..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/model/SManga.kt +++ /dev/null @@ -1,34 +0,0 @@ -package eu.kanade.tachiyomi.source.model - -interface SManga { - - var url: String - - var title: String - - var artist: String? - - var author: String? - - var description: String? - - var genre: String? - - var status: Int - - var thumbnail_url: String? - - var initialized: Boolean - - companion object { - const val UNKNOWN = 0 - const val ONGOING = 1 - const val COMPLETED = 2 - const val LICENSED = 3 - - fun create(): SManga { - throw Exception("Stub!") - } - } - -} \ No newline at end of file diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/online/ParsedHttpSource.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/source/online/ParsedHttpSource.kt deleted file mode 100644 index 2707fcc16..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/source/online/ParsedHttpSource.kt +++ /dev/null @@ -1,169 +0,0 @@ -package eu.kanade.tachiyomi.source.online - -import eu.kanade.tachiyomi.source.model.MangasPage -import eu.kanade.tachiyomi.source.model.Page -import eu.kanade.tachiyomi.source.model.SChapter -import eu.kanade.tachiyomi.source.model.SManga -import okhttp3.Response -import org.jsoup.nodes.Document -import org.jsoup.nodes.Element - -/** - * A simple implementation for sources from a website using Jsoup, an HTML parser. - */ -@Suppress("unused", "unused_parameter") -abstract class ParsedHttpSource : HttpSource() { - - /** - * Parses the response from the site and returns a [MangasPage] object. - * - * @param response the response from the site. - */ - override fun popularMangaParse(response: Response): MangasPage { - throw Exception("Stub!") - } - - /** - * Returns the Jsoup selector that returns a list of [Element] corresponding to each manga. - */ - abstract protected fun popularMangaSelector(): String - - /** - * Returns a manga from the given [element]. Most sites only show the title and the url, it's - * totally fine to fill only those two values. - * - * @param element an element obtained from [popularMangaSelector]. - */ - abstract protected fun popularMangaFromElement(element: Element): SManga - - /** - * Returns the Jsoup selector that returns the tag linking to the next page, or null if - * there's no next page. - */ - abstract protected fun popularMangaNextPageSelector(): String? - - /** - * Parses the response from the site and returns a [MangasPage] object. - * - * @param response the response from the site. - */ - override fun searchMangaParse(response: Response): MangasPage { - throw Exception("Stub!") - } - - /** - * Returns the Jsoup selector that returns a list of [Element] corresponding to each manga. - */ - abstract protected fun searchMangaSelector(): String - - /** - * Returns a manga from the given [element]. Most sites only show the title and the url, it's - * totally fine to fill only those two values. - * - * @param element an element obtained from [searchMangaSelector]. - */ - abstract protected fun searchMangaFromElement(element: Element): SManga - - /** - * Returns the Jsoup selector that returns the tag linking to the next page, or null if - * there's no next page. - */ - abstract protected fun searchMangaNextPageSelector(): String? - - /** - * Parses the response from the site and returns a [MangasPage] object. - * - * @param response the response from the site. - */ - override fun latestUpdatesParse(response: Response): MangasPage { - throw Exception("Stub!") - } - - /** - * Returns the Jsoup selector that returns a list of [Element] corresponding to each manga. - */ - abstract protected fun latestUpdatesSelector(): String - - /** - * Returns a manga from the given [element]. Most sites only show the title and the url, it's - * totally fine to fill only those two values. - * - * @param element an element obtained from [latestUpdatesSelector]. - */ - abstract protected fun latestUpdatesFromElement(element: Element): SManga - - /** - * Returns the Jsoup selector that returns the tag linking to the next page, or null if - * there's no next page. - */ - abstract protected fun latestUpdatesNextPageSelector(): String? - - /** - * Parses the response from the site and returns the details of a manga. - * - * @param response the response from the site. - */ - override fun mangaDetailsParse(response: Response): SManga { - throw Exception("Stub!") - } - - /** - * Returns the details of the manga from the given [document]. - * - * @param document the parsed document. - */ - abstract protected fun mangaDetailsParse(document: Document): SManga - - /** - * Parses the response from the site and returns a list of chapters. - * - * @param response the response from the site. - */ - override fun chapterListParse(response: Response): List { - throw Exception("Stub!") - } - - /** - * Returns the Jsoup selector that returns a list of [Element] corresponding to each chapter. - */ - abstract protected fun chapterListSelector(): String - - /** - * Returns a chapter from the given element. - * - * @param element an element obtained from [chapterListSelector]. - */ - abstract protected fun chapterFromElement(element: Element): SChapter - - /** - * Parses the response from the site and returns the page list. - * - * @param response the response from the site. - */ - override fun pageListParse(response: Response): List { - throw Exception("Stub!") - } - - /** - * Returns a page list from the given document. - * - * @param document the parsed document. - */ - abstract protected fun pageListParse(document: Document): List - - /** - * Parse the response from the site and returns the absolute url to the source image. - * - * @param response the response from the site. - */ - override fun imageUrlParse(response: Response): String { - throw Exception("Stub!") - } - - /** - * Returns the absolute url to the source image from the document. - * - * @param document the parsed document. - */ - abstract protected fun imageUrlParse(document: Document): String -} diff --git a/lib/extension/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt b/lib/extension/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt deleted file mode 100644 index bb61bc147..000000000 --- a/lib/extension/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt +++ /dev/null @@ -1,12 +0,0 @@ -package eu.kanade.tachiyomi.util - -import okhttp3.Response -import org.jsoup.nodes.Document - -/** - * Returns a Jsoup document for this response. - * @param html the body of the response. Use only if the body was read before calling this method. - */ -fun Response.asJsoup(html: String? = null): Document { - throw Exception("Stub!") -} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 0c1be2acf..baa18a693 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,6 +1,3 @@ -include ':lib-extension' -project(':lib-extension').projectDir = new File("lib/extension") - include ':lib-ratelimit' project(':lib-ratelimit').projectDir = new File("lib/ratelimit")