This commit is contained in:
parent
f9ba13dc32
commit
27bb056397
@ -249,7 +249,6 @@ class ArticleFragment : Fragment(), DIAware {
|
|||||||
private fun getContentFromMercury() {
|
private fun getContentFromMercury() {
|
||||||
if (repository.isNetworkAvailable()) {
|
if (repository.isNetworkAvailable()) {
|
||||||
binding.progressBar.visibility = View.VISIBLE
|
binding.progressBar.visibility = View.VISIBLE
|
||||||
// TODO: The api should be accessed through the repository
|
|
||||||
val parser = MercuryApi()
|
val parser = MercuryApi()
|
||||||
|
|
||||||
parser.parseUrl(url).enqueue(
|
parser.parseUrl(url).enqueue(
|
||||||
|
@ -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
|
fun isNetworkAvailable() = isConnectionAvailable.value && !offlineOverride
|
||||||
|
|
||||||
private fun getDBActions(): List<ACTION> =
|
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
|
// TODO: This function should check for duplicate items
|
||||||
suspend fun tryToCacheItemsAndGetNewOnes(): List<SelfossModel.Item> {
|
suspend fun tryToCacheItemsAndGetNewOnes(): List<SelfossModel.Item> {
|
||||||
try {
|
try {
|
||||||
val previousNewItems = getDBItems().count { it.unread }
|
|
||||||
val newItems = getMaxItemsForBackground(ItemType.UNREAD)
|
val newItems = getMaxItemsForBackground(ItemType.UNREAD)
|
||||||
val allItems = getMaxItemsForBackground(ItemType.ALL)
|
val allItems = getMaxItemsForBackground(ItemType.ALL)
|
||||||
val starredItems = getMaxItemsForBackground(ItemType.STARRED)
|
val starredItems = getMaxItemsForBackground(ItemType.STARRED)
|
||||||
|
Loading…
Reference in New Issue
Block a user