diff --git a/app/src/main/java/com/droiddeck/launcher/ui/LibraryPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/LibraryPage.kt index 3c26a37558..a90aa79ca8 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/LibraryPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/LibraryPage.kt @@ -282,7 +282,7 @@ internal fun LibraryPage(s: FrontEndState, a: FrontEndActions, selected: String, val gameJoltSignedIn = owned.containsKey(Store.GAMEJOLT) val sources = librarySources( all, SessionPrefs.storesTabOrder(ctx), - listOfNotNull(Store.ITCH.id.takeIf { itchSignedIn && !soundMode }, Store.GAMEJOLT.id.takeIf { gameJoltSignedIn && !soundMode }, Library.SOURCE_COLLECTION.takeIf { soundMode }).toSet(), + listOfNotNull(Store.ITCH.id.takeIf { itchSignedIn && !soundMode }, Store.GAMEJOLT.id.takeIf { gameJoltSignedIn && !soundMode }).toSet(), favorites, concealed, LibraryDisplay.hidden && !soundMode, ) val source = LibraryView.source.takeIf { it == LIBRARY_ALL || it in sources } ?: LIBRARY_ALL diff --git a/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackCollectionsTest.kt b/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackCollectionsTest.kt index 8ae6166895..3d85fc18ff 100644 --- a/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackCollectionsTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/frontend/SoundtrackCollectionsTest.kt @@ -44,11 +44,11 @@ class SoundtrackCollectionsTest { @Test fun emptyFavoritesCanBeLeftOutOfTheLibraryList() { val context = androidx.test.core.app.ApplicationProvider.getApplicationContext() SoundtrackCollections.load(context) - SoundtrackCollections.create(context, "Chill", emptyList()) - val ids = { skip: Boolean -> SoundtrackCollections.games(context, "Favorites", skip).map { it.appId } } - assertTrue(SoundtrackCollections.FAVORITES_ID in ids(false)) - assertFalse(SoundtrackCollections.FAVORITES_ID in ids(true)) - SoundtrackCollections.add(context, SoundtrackCollections.FAVORITES_ID, listOf(ref("a"))) - assertTrue(SoundtrackCollections.FAVORITES_ID in ids(true)) + val custom = SoundtrackCollections.create(context, "Chill", emptyList())!! + val favorites = SoundtrackCollections.FAVORITES_ID + assertEquals(listOf(custom), SoundtrackCollections.games(context, "Favorites", skipEmptyFavorites = true).map { it.appId }) + assertEquals(listOf(favorites, custom), SoundtrackCollections.games(context, "Favorites").map { it.appId }) + SoundtrackCollections.add(context, favorites, listOf(ref("a"))) + assertEquals(listOf(favorites, custom), SoundtrackCollections.games(context, "Favorites", skipEmptyFavorites = true).map { it.appId }) } }