Move unread chapters badge setting to General section

This commit is contained in:
arkon
2021-10-30 12:42:59 -04:00
parent 90b312a56e
commit 709de81814
9 changed files with 19 additions and 15 deletions

View File

@@ -291,7 +291,7 @@ class LibraryUpdateService(
val failedUpdates = CopyOnWriteArrayList<Pair<Manga, String?>>()
val hasDownloads = AtomicBoolean(false)
val loggedServices by lazy { trackManager.services.filter { it.isLogged } }
val currentUnreadUpdatesCount = preferences.libraryUnreadUpdatesCount().get()
val currentUnreadUpdatesCount = preferences.unreadUpdatesCount().get()
withIOContext {
mangaToUpdate.groupBy { it.source }
@@ -356,7 +356,7 @@ class LibraryUpdateService(
if (newUpdates.isNotEmpty()) {
notifier.showUpdateNotifications(newUpdates)
val newChapterCount = newUpdates.sumOf { it.second.size }
preferences.libraryUnreadUpdatesCount().set(currentUnreadUpdatesCount + newChapterCount)
preferences.unreadUpdatesCount().set(currentUnreadUpdatesCount + newChapterCount)
if (hasDownloads.get()) {
DownloadService.start(this)
}

View File

@@ -133,7 +133,7 @@ object PreferenceKeys {
const val libraryUpdateRestriction = "library_update_restriction"
const val libraryUpdateShowTabBadge = "library_update_show_tab_badge"
const val showUpdatesNavBadge = "library_update_show_tab_badge"
const val libraryUpdateCategories = "library_update_categories"
const val libraryUpdateCategoriesExclude = "library_update_categories_exclude"

View File

@@ -238,8 +238,8 @@ class PreferencesHelper(val context: Context) {
fun libraryUpdateRestriction() = flowPrefs.getStringSet(Keys.libraryUpdateRestriction, setOf(ONLY_ON_WIFI))
fun libraryUpdateShowTabBadge() = flowPrefs.getBoolean(Keys.libraryUpdateShowTabBadge, true)
fun libraryUnreadUpdatesCount() = flowPrefs.getInt("library_unread_updates_count", 0)
fun showUpdatesNavBadge() = flowPrefs.getBoolean(Keys.showUpdatesNavBadge, true)
fun unreadUpdatesCount() = flowPrefs.getInt("library_unread_updates_count", 0)
fun libraryUpdateCategories() = flowPrefs.getStringSet(Keys.libraryUpdateCategories, emptySet())
fun libraryUpdateCategoriesExclude() = flowPrefs.getStringSet(Keys.libraryUpdateCategoriesExclude, emptySet())