This commit is contained in:
davidoskky 2022-09-30 11:49:31 +02:00
parent f9ba13dc32
commit 27bb056397
2 changed files with 0 additions and 4 deletions

View File

@ -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(

View File

@ -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<ACTION> =
@ -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<SelfossModel.Item> {
try {
val previousNewItems = getDBItems().count { it.unread }
val newItems = getMaxItemsForBackground(ItemType.UNREAD)
val allItems = getMaxItemsForBackground(ItemType.ALL)
val starredItems = getMaxItemsForBackground(ItemType.STARRED)