|
@@ -527,6 +527,8 @@ class LibraryScreenModel(
|
|
}
|
|
}
|
|
|
|
|
|
suspend fun getRandomLibraryItemForCurrentCategory(): LibraryItem? {
|
|
suspend fun getRandomLibraryItemForCurrentCategory(): LibraryItem? {
|
|
|
|
+ if (state.value.categories.isEmpty()) return null
|
|
|
|
+
|
|
return withIOContext {
|
|
return withIOContext {
|
|
state.value
|
|
state.value
|
|
.getLibraryItemsByCategoryId(state.value.categories[activeCategoryIndex].id)
|
|
.getLibraryItemsByCategoryId(state.value.categories[activeCategoryIndex].id)
|