Add "Started" library filter and library update restriction (#6382)
* Add chapter read count to library manga Co-Authored-By: Jays2Kings <jays@outlook.com> * Add "Started" library filter and library update restriction * Update Filter when its changed * Add back accidentally removed stuff. * Update.. * Change variable names * Change Variable name where I missed Co-authored-by: Jays2Kings <jays@outlook.com>
This commit is contained in:
@@ -21,6 +21,7 @@ import eu.kanade.tachiyomi.data.library.LibraryUpdateService.Companion.start
|
||||
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||
import eu.kanade.tachiyomi.data.preference.MANGA_FULLY_READ
|
||||
import eu.kanade.tachiyomi.data.preference.MANGA_ONGOING
|
||||
import eu.kanade.tachiyomi.data.preference.MANGA_STARTED
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.data.track.EnhancedTrackService
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
@@ -266,7 +267,14 @@ class LibraryUpdateService(
|
||||
listToUpdate = listToUpdate.filterNot { it.status == SManga.COMPLETED }
|
||||
}
|
||||
if (MANGA_FULLY_READ in restrictions) {
|
||||
listToUpdate = listToUpdate.filter { it.unread == 0 }
|
||||
listToUpdate = listToUpdate.filter { it.unreadCount == 0 }
|
||||
}
|
||||
if (MANGA_STARTED in restrictions) {
|
||||
listToUpdate = listToUpdate.filter { manga ->
|
||||
// If the manga has 0 chapters you can't actually start reading it
|
||||
if (manga.totalChapters == 0) true
|
||||
else manga.hasStarted
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user