Suppress unused warnings

This commit is contained in:
arkon 2023-08-25 22:30:04 -04:00
parent b23845a1ef
commit 7c0b891286
13 changed files with 36 additions and 27 deletions

View File

@ -4,6 +4,7 @@ import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import rx.Observable
@Suppress("unused")
interface CatalogueSource : Source {
/**

View File

@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.source
import androidx.preference.PreferenceScreen
@Suppress("unused")
interface ConfigurableSource {
fun setupPreferenceScreen(screen: PreferenceScreen)

View File

@ -8,6 +8,7 @@ import rx.Observable
/**
* A basic interface for creating a source. It could be an online source, a local source, etc...
*/
@Suppress("unused")
interface Source {
/**

View File

@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.source
/**
* A factory for creating sources at runtime.
*/
@Suppress("unused")
interface SourceFactory {
/**
* Create a new copy of the sources

View File

@ -5,4 +5,5 @@ package eu.kanade.tachiyomi.source
*
* This typically applies for self-hosted sources.
*/
@Suppress("unused")
interface UnmeteredSource

View File

@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.source.model
@Suppress("unused")
sealed class Filter<T>(val name: String, var state: T) {
open class Header(name: String) : Filter<Any>(name, 0)
open class Separator(name: String = "") : Filter<Any>(name, 0)

View File

@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.source.model
@Suppress("unused")
data class FilterList(val list: List<Filter<*>>) : List<Filter<*>> by list {
constructor(vararg fs: Filter<*>) : this(if (fs.isNotEmpty()) fs.asList() else emptyList())

View File

@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.source.model
import android.net.Uri
@Suppress("unused")
class Page(
val index: Int,
val url: String = "",

View File

@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.source.model
@Suppress("unused")
interface SChapter {
var url: String
@ -17,5 +18,4 @@ interface SChapter {
throw Exception("Stub!")
}
}
}

View File

@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.source.model
@Suppress("unused")
interface SManga {
var url: String
@ -35,5 +36,4 @@ interface SManga {
throw Exception("Stub!")
}
}
}

View File

@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.source.model
@Suppress("unused")
enum class UpdateStrategy {
ALWAYS_UPDATE,
ONLY_FETCH_ONCE

View File

@ -77,14 +77,14 @@ abstract class HttpSource : CatalogueSource {
*
* @param page the page number to retrieve.
*/
abstract protected fun popularMangaRequest(page: Int): Request
protected abstract fun popularMangaRequest(page: Int): Request
/**
* Parses the response from the site and returns a [MangasPage] object.
*
* @param response the response from the site.
*/
abstract protected fun popularMangaParse(response: Response): MangasPage
protected abstract fun popularMangaParse(response: Response): MangasPage
/**
* Returns an observable containing a page with a list of manga. Normally it's not needed to
@ -105,14 +105,14 @@ abstract class HttpSource : CatalogueSource {
* @param query the search query.
* @param filters the list of filters to apply.
*/
abstract protected fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request
protected abstract fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request
/**
* Parses the response from the site and returns a [MangasPage] object.
*
* @param response the response from the site.
*/
abstract protected fun searchMangaParse(response: Response): MangasPage
protected abstract fun searchMangaParse(response: Response): MangasPage
/**
* Returns an observable containing a page with a list of latest manga updates.
@ -128,14 +128,14 @@ abstract class HttpSource : CatalogueSource {
*
* @param page the page number to retrieve.
*/
abstract protected fun latestUpdatesRequest(page: Int): Request
protected abstract fun latestUpdatesRequest(page: Int): Request
/**
* Parses the response from the site and returns a [MangasPage] object.
*
* @param response the response from the site.
*/
abstract protected fun latestUpdatesParse(response: Response): MangasPage
protected abstract fun latestUpdatesParse(response: Response): MangasPage
/**
* Returns an observable with the updated details for a manga. Normally it's not needed to
@ -162,7 +162,7 @@ abstract class HttpSource : CatalogueSource {
*
* @param response the response from the site.
*/
abstract protected fun mangaDetailsParse(response: Response): SManga
protected abstract fun mangaDetailsParse(response: Response): SManga
/**
* Returns an observable with the updated chapter list for a manga. Normally it's not needed to
@ -189,7 +189,7 @@ abstract class HttpSource : CatalogueSource {
*
* @param response the response from the site.
*/
abstract protected fun chapterListParse(response: Response): List<SChapter>
protected abstract fun chapterListParse(response: Response): List<SChapter>
/**
* Returns an observable with the page list for a chapter.
@ -215,7 +215,7 @@ abstract class HttpSource : CatalogueSource {
*
* @param response the response from the site.
*/
abstract protected fun pageListParse(response: Response): List<Page>
protected abstract fun pageListParse(response: Response): List<Page>
/**
* Returns an observable with the page containing the source url of the image. If there's any
@ -242,7 +242,7 @@ abstract class HttpSource : CatalogueSource {
*
* @param response the response from the site.
*/
abstract protected fun imageUrlParse(response: Response): String
protected abstract fun imageUrlParse(response: Response): String
/**
* Returns an observable with the response of the source image.

View File

@ -11,7 +11,7 @@ import org.jsoup.nodes.Element
/**
* A simple implementation for sources from a website using Jsoup, an HTML parser.
*/
@Suppress("unused", "unused_parameter")
@Suppress("unused")
abstract class ParsedHttpSource : HttpSource() {
/**
@ -26,7 +26,7 @@ abstract class ParsedHttpSource : HttpSource() {
/**
* Returns the Jsoup selector that returns a list of [Element] corresponding to each manga.
*/
abstract protected fun popularMangaSelector(): String
protected abstract fun popularMangaSelector(): String
/**
* Returns a manga from the given [element]. Most sites only show the title and the url, it's
@ -34,13 +34,13 @@ abstract class ParsedHttpSource : HttpSource() {
*
* @param element an element obtained from [popularMangaSelector].
*/
abstract protected fun popularMangaFromElement(element: Element): SManga
protected abstract fun popularMangaFromElement(element: Element): SManga
/**
* Returns the Jsoup selector that returns the <a> tag linking to the next page, or null if
* there's no next page.
*/
abstract protected fun popularMangaNextPageSelector(): String?
protected abstract fun popularMangaNextPageSelector(): String?
/**
* Parses the response from the site and returns a [MangasPage] object.
@ -54,7 +54,7 @@ abstract class ParsedHttpSource : HttpSource() {
/**
* Returns the Jsoup selector that returns a list of [Element] corresponding to each manga.
*/
abstract protected fun searchMangaSelector(): String
protected abstract fun searchMangaSelector(): String
/**
* Returns a manga from the given [element]. Most sites only show the title and the url, it's
@ -62,13 +62,13 @@ abstract class ParsedHttpSource : HttpSource() {
*
* @param element an element obtained from [searchMangaSelector].
*/
abstract protected fun searchMangaFromElement(element: Element): SManga
protected abstract fun searchMangaFromElement(element: Element): SManga
/**
* Returns the Jsoup selector that returns the <a> tag linking to the next page, or null if
* there's no next page.
*/
abstract protected fun searchMangaNextPageSelector(): String?
protected abstract fun searchMangaNextPageSelector(): String?
/**
* Parses the response from the site and returns a [MangasPage] object.
@ -82,7 +82,7 @@ abstract class ParsedHttpSource : HttpSource() {
/**
* Returns the Jsoup selector that returns a list of [Element] corresponding to each manga.
*/
abstract protected fun latestUpdatesSelector(): String
protected abstract fun latestUpdatesSelector(): String
/**
* Returns a manga from the given [element]. Most sites only show the title and the url, it's
@ -90,13 +90,13 @@ abstract class ParsedHttpSource : HttpSource() {
*
* @param element an element obtained from [latestUpdatesSelector].
*/
abstract protected fun latestUpdatesFromElement(element: Element): SManga
protected abstract fun latestUpdatesFromElement(element: Element): SManga
/**
* Returns the Jsoup selector that returns the <a> tag linking to the next page, or null if
* there's no next page.
*/
abstract protected fun latestUpdatesNextPageSelector(): String?
protected abstract fun latestUpdatesNextPageSelector(): String?
/**
* Parses the response from the site and returns the details of a manga.
@ -112,7 +112,7 @@ abstract class ParsedHttpSource : HttpSource() {
*
* @param document the parsed document.
*/
abstract protected fun mangaDetailsParse(document: Document): SManga
protected abstract fun mangaDetailsParse(document: Document): SManga
/**
* Parses the response from the site and returns a list of chapters.
@ -126,14 +126,14 @@ abstract class ParsedHttpSource : HttpSource() {
/**
* Returns the Jsoup selector that returns a list of [Element] corresponding to each chapter.
*/
abstract protected fun chapterListSelector(): String
protected abstract fun chapterListSelector(): String
/**
* Returns a chapter from the given element.
*
* @param element an element obtained from [chapterListSelector].
*/
abstract protected fun chapterFromElement(element: Element): SChapter
protected abstract fun chapterFromElement(element: Element): SChapter
/**
* Parses the response from the site and returns the page list.
@ -149,7 +149,7 @@ abstract class ParsedHttpSource : HttpSource() {
*
* @param document the parsed document.
*/
abstract protected fun pageListParse(document: Document): List<Page>
protected abstract fun pageListParse(document: Document): List<Page>
/**
* Parse the response from the site and returns the absolute url to the source image.
@ -165,5 +165,5 @@ abstract class ParsedHttpSource : HttpSource() {
*
* @param document the parsed document.
*/
abstract protected fun imageUrlParse(document: Document): String
protected abstract fun imageUrlParse(document: Document): String
}