Repository Unit Tests #50
@ -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()
|
||||
AmineB marked this conversation as resolved
Outdated
|
||||
|
||||
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
|
||||
AmineB marked this conversation as resolved
Outdated
AmineB
commented
Because of the mercury api using this, can you remove this comment, please ? Because of the mercury api using this, can you remove this comment, please ?
|
||||
|
||||
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 {
|
||||
AmineB marked this conversation as resolved
Outdated
AmineB
commented
I think that the DB handles the duplicates. I think that the DB handles the duplicates.
davidoskky
commented
Does it use the id to check for duplicates? If that is the case then all is good. Does it use the id to check for duplicates? If that is the case then all is good.
|
||||
val previousNewItems = getDBItems().count { it.unread }
|
||||
val newItems = getMaxItemsForBackground(ItemType.UNREAD)
|
||||
val allItems = getMaxItemsForBackground(ItemType.ALL)
|
||||
val starredItems = getMaxItemsForBackground(ItemType.STARRED)
|
||||
AmineB marked this conversation as resolved
Outdated
AmineB
commented
This is useless. This is useless.
|
||||
|
Loading…
Reference in New Issue
Block a user
Please remove this comment.