mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-14 21:18:56 +01:00
Add filter for tracking (#4276)
* Add filter for tracking or not * Use .any * Access database only when needed
This commit is contained in:
@@ -10,6 +10,15 @@ import eu.kanade.tachiyomi.data.track.TrackService
|
||||
|
||||
interface TrackQueries : DbProvider {
|
||||
|
||||
fun getTracks() = db.get()
|
||||
.listOfObjects(Track::class.java)
|
||||
.withQuery(
|
||||
Query.builder()
|
||||
.table(TrackTable.TABLE)
|
||||
.build()
|
||||
)
|
||||
.prepare()
|
||||
|
||||
fun getTracks(manga: Manga) = db.get()
|
||||
.listOfObjects(Track::class.java)
|
||||
.withQuery(
|
||||
|
||||
@@ -123,6 +123,8 @@ object PreferenceKeys {
|
||||
|
||||
const val filterCompleted = "pref_filter_library_completed"
|
||||
|
||||
const val filterTracking = "pref_filter_library_tracking"
|
||||
|
||||
const val librarySortingMode = "library_sorting_mode"
|
||||
|
||||
const val automaticExtUpdates = "automatic_ext_updates"
|
||||
|
||||
@@ -221,6 +221,8 @@ class PreferencesHelper(val context: Context) {
|
||||
|
||||
fun filterCompleted() = flowPrefs.getInt(Keys.filterCompleted, ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value)
|
||||
|
||||
fun filterTracking() = flowPrefs.getInt(Keys.filterTracking, ExtendedNavigationView.Item.TriStateGroup.State.IGNORE.value)
|
||||
|
||||
fun librarySortingMode() = flowPrefs.getInt(Keys.librarySortingMode, 0)
|
||||
|
||||
fun librarySortingAscending() = flowPrefs.getBoolean("library_sorting_ascending", true)
|
||||
|
||||
Reference in New Issue
Block a user