@@ -95,7 +95,7 @@ class LibraryPresenter(
95
95
private val updateChapter: UpdateChapters by injectLazy()
96
96
private val updateManga: UpdateManga by injectLazy()
97
97
98
- private var libraryManga: List <LibraryManga > = emptyList()
98
+ // private var libraryManga: List<LibraryManga> = emptyList()
99
99
100
100
private val context = preferences.context
101
101
private val viewContext
@@ -181,12 +181,18 @@ class LibraryPresenter(
181
181
lastLibraryItems = null
182
182
lastAllLibraryItems = null
183
183
}
184
+
185
+ /*
184
186
presenterScope.launch {
185
187
getLibraryManga.subscribe().collectLatest {
186
188
libraryManga = it.apply { if (groupType > BY_DEFAULT) { distinctBy { it.id } } }
187
- getLibrary(false )
189
+ getLibrary()
188
190
}
189
191
}
192
+ */
193
+
194
+ getLibrary()
195
+
190
196
if (! preferences.showLibrarySearchSuggestions().isSet()) {
191
197
DelayedLibrarySuggestionsJob .setupTask(context, true )
192
198
} else if (preferences.showLibrarySearchSuggestions().get() &&
@@ -210,7 +216,7 @@ class LibraryPresenter(
210
216
}
211
217
212
218
/* * Get favorited manga for library and sort and filter it */
213
- fun getLibrary (forceFetch : Boolean = true ) {
219
+ fun getLibrary () {
214
220
presenterScope.launch {
215
221
if (categories.isEmpty()) {
216
222
val dbCategories = getCategories.await()
@@ -220,7 +226,7 @@ class LibraryPresenter(
220
226
categories = lastCategories ? : getCategories.await().toMutableList()
221
227
}
222
228
223
- val (library, hiddenItems) = withIOContext { getLibraryFromDB(forceFetch ) }
229
+ val (library, hiddenItems) = withIOContext { getLibraryFromDB() }
224
230
setDownloadCount(library)
225
231
setUnreadBadge(library)
226
232
setSourceLanguage(library)
@@ -776,11 +782,10 @@ class LibraryPresenter(
776
782
*
777
783
* @return an list of all the manga in a itemized form.
778
784
*/
779
- private suspend fun getLibraryFromDB (forceFetch : Boolean = false ): Pair <List <LibraryItem >, List<LibraryItem>> {
785
+ private suspend fun getLibraryFromDB (): Pair <List <LibraryItem >, List<LibraryItem>> {
780
786
removeArticles = preferences.removeArticles().get()
781
787
val categories = getCategories.await().toMutableList()
782
- if (forceFetch)
783
- libraryManga = getLibraryManga.await().apply { if (groupType > BY_DEFAULT ) { distinctBy { it.id } } }
788
+ val libraryManga = getLibraryManga.await().apply { if (groupType > BY_DEFAULT ) { distinctBy { it.id } } }
784
789
val showAll = showAllCategories
785
790
val hiddenItems = mutableListOf<LibraryItem >()
786
791
0 commit comments