Skip to content

Commit

Permalink
Enable "Latest" view mode (#8)
Browse files Browse the repository at this point in the history
* Uses the existing "Date added" filter
  • Loading branch information
BrutuZ authored Sep 11, 2024
1 parent c82e8ce commit fdd59a8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
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

0 comments on commit fdd59a8

Please sign in to comment.