From 7c0b891286bc6c50ccb1d6824fcfdb7f0ffbc94b Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 25 Aug 2023 22:30:04 -0400 Subject: [PATCH] Suppress unused warnings --- .../tachiyomi/source/CatalogueSource.kt | 1 + .../tachiyomi/source/ConfigurableSource.kt | 1 + .../java/eu/kanade/tachiyomi/source/Source.kt | 1 + .../kanade/tachiyomi/source/SourceFactory.kt | 1 + .../tachiyomi/source/UnmeteredSource.kt | 1 + .../kanade/tachiyomi/source/model/Filter.kt | 1 + .../tachiyomi/source/model/FilterList.kt | 1 + .../eu/kanade/tachiyomi/source/model/Page.kt | 1 + .../kanade/tachiyomi/source/model/SChapter.kt | 2 +- .../kanade/tachiyomi/source/model/SManga.kt | 2 +- .../tachiyomi/source/model/UpdateStrategy.kt | 1 + .../tachiyomi/source/online/HttpSource.kt | 20 ++++++------- .../source/online/ParsedHttpSource.kt | 30 +++++++++---------- 13 files changed, 36 insertions(+), 27 deletions(-) diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/CatalogueSource.kt b/library/src/main/java/eu/kanade/tachiyomi/source/CatalogueSource.kt index f5f11a0..fbb17fc 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/CatalogueSource.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/CatalogueSource.kt @@ -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 { /** diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/ConfigurableSource.kt b/library/src/main/java/eu/kanade/tachiyomi/source/ConfigurableSource.kt index f6de8d3..2b00112 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/ConfigurableSource.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/ConfigurableSource.kt @@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.source import androidx.preference.PreferenceScreen +@Suppress("unused") interface ConfigurableSource { fun setupPreferenceScreen(screen: PreferenceScreen) diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/Source.kt b/library/src/main/java/eu/kanade/tachiyomi/source/Source.kt index 7a5f43a..4e00356 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/Source.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/Source.kt @@ -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 { /** diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/SourceFactory.kt b/library/src/main/java/eu/kanade/tachiyomi/source/SourceFactory.kt index d326c43..b6bde02 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/SourceFactory.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/SourceFactory.kt @@ -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 diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/UnmeteredSource.kt b/library/src/main/java/eu/kanade/tachiyomi/source/UnmeteredSource.kt index 7536ccb..89af0ff 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/UnmeteredSource.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/UnmeteredSource.kt @@ -5,4 +5,5 @@ package eu.kanade.tachiyomi.source * * This typically applies for self-hosted sources. */ +@Suppress("unused") interface UnmeteredSource diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/model/Filter.kt b/library/src/main/java/eu/kanade/tachiyomi/source/model/Filter.kt index a656878..b2ab3ef 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/model/Filter.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/model/Filter.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.source.model +@Suppress("unused") 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) diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/model/FilterList.kt b/library/src/main/java/eu/kanade/tachiyomi/source/model/FilterList.kt index e24db65..e431a14 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/model/FilterList.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/model/FilterList.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.source.model +@Suppress("unused") data class FilterList(val list: List>) : List> by list { constructor(vararg fs: Filter<*>) : this(if (fs.isNotEmpty()) fs.asList() else emptyList()) diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/model/Page.kt b/library/src/main/java/eu/kanade/tachiyomi/source/model/Page.kt index 39715eb..05e62cb 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/model/Page.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/model/Page.kt @@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.source.model import android.net.Uri +@Suppress("unused") class Page( val index: Int, val url: String = "", diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/model/SChapter.kt b/library/src/main/java/eu/kanade/tachiyomi/source/model/SChapter.kt index ca571b8..7039b2a 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/model/SChapter.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/model/SChapter.kt @@ -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!") } } - } \ No newline at end of file diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/model/SManga.kt b/library/src/main/java/eu/kanade/tachiyomi/source/model/SManga.kt index 3ecb11e..99530b9 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/model/SManga.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/model/SManga.kt @@ -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!") } } - } \ No newline at end of file diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/model/UpdateStrategy.kt b/library/src/main/java/eu/kanade/tachiyomi/source/model/UpdateStrategy.kt index aa1d701..c484236 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/model/UpdateStrategy.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/model/UpdateStrategy.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.source.model +@Suppress("unused") enum class UpdateStrategy { ALWAYS_UPDATE, ONLY_FETCH_ONCE diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/online/HttpSource.kt b/library/src/main/java/eu/kanade/tachiyomi/source/online/HttpSource.kt index 59f6d31..e6b0fed 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/online/HttpSource.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/online/HttpSource.kt @@ -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 + protected abstract fun chapterListParse(response: Response): List /** * 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 + protected abstract fun pageListParse(response: Response): List /** * 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. diff --git a/library/src/main/java/eu/kanade/tachiyomi/source/online/ParsedHttpSource.kt b/library/src/main/java/eu/kanade/tachiyomi/source/online/ParsedHttpSource.kt index 2707fcc..d234b0c 100644 --- a/library/src/main/java/eu/kanade/tachiyomi/source/online/ParsedHttpSource.kt +++ b/library/src/main/java/eu/kanade/tachiyomi/source/online/ParsedHttpSource.kt @@ -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 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 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 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 + protected abstract fun pageListParse(document: Document): List /** * 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 }