From 27bb056397f60dba7e78ef5c4647cb7be2e68482 Mon Sep 17 00:00:00 2001 From: davidoskky Date: Fri, 30 Sep 2022 11:49:31 +0200 Subject: [PATCH] Cleanup --- .../readerforselfossv2/android/fragments/ArticleFragment.kt | 1 - .../amine/apps/readerforselfossv2/repository/RepositoryImpl.kt | 3 --- 2 files changed, 4 deletions(-) diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt index 6e0b18b..4e9ada7 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt @@ -249,7 +249,6 @@ class ArticleFragment : Fragment(), DIAware { private fun getContentFromMercury() { if (repository.isNetworkAvailable()) { binding.progressBar.visibility = View.VISIBLE - // TODO: The api should be accessed through the repository val parser = MercuryApi() parser.parseUrl(url).enqueue( diff --git a/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/repository/RepositoryImpl.kt b/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/repository/RepositoryImpl.kt index eb6e794..7b1cea2 100644 --- a/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/repository/RepositoryImpl.kt +++ b/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/repository/RepositoryImpl.kt @@ -403,8 +403,6 @@ class Repository(private val api: SelfossApi, private val appSettingsService: Ap } } - // TODO: This should be private (since all api calls are made through the repository - // no other entity needs to know about the connectivity status) fun isNetworkAvailable() = isConnectionAvailable.value && !offlineOverride private fun getDBActions(): List = @@ -458,7 +456,6 @@ class Repository(private val api: SelfossApi, private val appSettingsService: Ap // TODO: This function should check for duplicate items suspend fun tryToCacheItemsAndGetNewOnes(): List { try { - val previousNewItems = getDBItems().count { it.unread } val newItems = getMaxItemsForBackground(ItemType.UNREAD) val allItems = getMaxItemsForBackground(ItemType.ALL) val starredItems = getMaxItemsForBackground(ItemType.STARRED)