diff --git a/android/app/src/main/java/com/audiobookshelf/app/media/MediaManager.kt b/android/app/src/main/java/com/audiobookshelf/app/media/MediaManager.kt index 2ca65fb9..975edd40 100644 --- a/android/app/src/main/java/com/audiobookshelf/app/media/MediaManager.kt +++ b/android/app/src/main/java/com/audiobookshelf/app/media/MediaManager.kt @@ -95,12 +95,13 @@ class MediaManager(var apiHandler: ApiHandler, var ctx: Context) { } else { apiHandler.getLibraryItems(libraryId) { libraryItems -> val libraryItemsWithAudio = libraryItems.filter { li -> li.checkHasTracks() } - if (libraryItemsWithAudio.isNotEmpty()) selectedLibraryId = libraryId + if (libraryItemsWithAudio.isNotEmpty()) { + selectedLibraryId = libraryId + } + serverLibraryItems = mutableListOf() libraryItemsWithAudio.forEach { libraryItem -> - if (serverLibraryItems.find { li -> li.id == libraryItem.id } == null) { serverLibraryItems.add(libraryItem) - } } cb(libraryItemsWithAudio) } @@ -307,17 +308,6 @@ class MediaManager(var apiHandler: ApiHandler, var ctx: Context) { // Only using book or podcast library categories for now libraryCategories.forEach { - - // Add items in continue listening to serverLibraryItems - if (it.id == "continue-listening") { - it.entities.forEach { libraryItemWrapper -> - val libraryItem = libraryItemWrapper as LibraryItem - if (serverLibraryItems.find { li -> li.id == libraryItem.id } == null) { - serverLibraryItems.add(libraryItem) - } - } - } - // Log.d(tag, "Found library category ${it.label} with type ${it.type}") if (it.type == library.mediaType) { // Log.d(tag, "Using library category ${it.id}") diff --git a/android/app/src/main/java/com/audiobookshelf/app/player/PlayerNotificationService.kt b/android/app/src/main/java/com/audiobookshelf/app/player/PlayerNotificationService.kt index 21afa518..704194c7 100644 --- a/android/app/src/main/java/com/audiobookshelf/app/player/PlayerNotificationService.kt +++ b/android/app/src/main/java/com/audiobookshelf/app/player/PlayerNotificationService.kt @@ -863,7 +863,7 @@ class PlayerNotificationService : MediaBrowserServiceCompat() { result.sendResult(localBrowseItems) } else { // Load categories - mediaManager.loadAndroidAutoItems() { libraryCategories -> + mediaManager.loadAndroidAutoItems { libraryCategories -> browseTree = BrowseTree(this, libraryCategories, mediaManager.serverLibraries) val children = browseTree[parentMediaId]?.map { item ->