Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable "Latest" view mode #8

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/all/tachidesk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ext {
extName = 'Suwayomi'
pkgNameSuffix = 'all.tachidesk'
extClass = '.Tachidesk'
extVersionCode = 15
extVersionCode = 16
}

apply from: "$rootDir/common.gradle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.UnmeteredSource
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.Filter.Sort.Selection
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
Expand Down Expand Up @@ -81,7 +82,7 @@ class Tachidesk : ConfigurableSource, UnmeteredSource, HttpSource() {
private val basePassword by lazy { getPrefBasePassword() }

override val lang = "all"
override val supportsLatest = false
override val supportsLatest = true

override val client: OkHttpClient =
network.client.newBuilder()
Expand All @@ -108,6 +109,22 @@ class Tachidesk : ConfigurableSource, UnmeteredSource, HttpSource() {
return fetchSearchManga(page, "", FilterList())
}

// ------------- Latest Manga -------------

override fun latestUpdatesRequest(page: Int): Request =
throw Exception("Not used")

override fun latestUpdatesParse(response: Response): MangasPage =
throw Exception("Not used")

override fun fetchLatestUpdates(page: Int): Observable<MangasPage> {
return fetchSearchManga(
page,
"",
FilterList(SortBy(sortByOptions).apply { state = Selection(3, false) }),
)
}

// ------------- Manga Details -------------

override fun getMangaUrl(manga: SManga): String {
Expand Down Expand Up @@ -631,10 +648,6 @@ class Tachidesk : ConfigurableSource, UnmeteredSource, HttpSource() {

// ------------- Not Used -------------

override fun latestUpdatesRequest(page: Int): Request = throw Exception("Not used")

override fun latestUpdatesParse(response: Response): MangasPage = throw Exception("Not used")

override fun pageListParse(response: Response): List<Page> = throw Exception("Not used")

override fun imageUrlParse(response: Response): String = throw Exception("Not used")
Expand Down