Use Plain Source over CatalogueSource (#2141)

This commit is contained in:
Mitchell Syer
2026-06-28 14:25:37 -04:00
committed by GitHub
parent 3031aa7ccd
commit 35b48114c6
18 changed files with 80 additions and 82 deletions

View File

@@ -24,8 +24,8 @@ import suwayomi.tachidesk.manga.impl.Search.SerializableGroup
import suwayomi.tachidesk.manga.impl.Search.getFilterList
import suwayomi.tachidesk.manga.impl.Search.setFilter
import suwayomi.tachidesk.manga.impl.Search.sourceSearch
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.registerCatalogueSource
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.unregisterCatalogueSource
import suwayomi.tachidesk.manga.impl.util.source.GetSource.registerSource
import suwayomi.tachidesk.manga.impl.util.source.GetSource.unregisterSource
import suwayomi.tachidesk.manga.impl.util.source.StubSource
import suwayomi.tachidesk.test.ApplicationTest
import suwayomi.tachidesk.test.createSMangas
@@ -53,7 +53,7 @@ class SearchTest : ApplicationTest() {
@BeforeAll
fun setup() {
registerCatalogueSource(sourceId to source)
registerSource(sourceId to source)
this.source.mangas = createSMangas(mangasCount)
}
@@ -70,7 +70,7 @@ class SearchTest : ApplicationTest() {
@AfterAll
fun teardown() {
unregisterCatalogueSource(this.sourceId)
unregisterSource(this.sourceId)
}
}
@@ -347,7 +347,7 @@ class FilterListTest : ApplicationTest() {
private fun registerSource(sourceClass: KClass<*>): EmptyFilterListSource =
synchronized(sourceClass) {
val source = sourceClass.primaryConstructor!!.call(sourceCount) as EmptyFilterListSource
registerCatalogueSource(sourceCount to source)
registerSource(sourceCount to source)
sourceCount++
source
}
@@ -355,7 +355,7 @@ class FilterListTest : ApplicationTest() {
@AfterAll
@JvmStatic
fun teardown() {
(0 until sourceCount).forEach { unregisterCatalogueSource(it) }
(0 until sourceCount).forEach { unregisterSource(it) }
}
}
}