mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-03 17:44:51 +02:00
Fix:Android auto load libraries handle no libraries returned, Update:Local media items cover images width alignment #279
This commit is contained in:
parent
2a87f1de28
commit
fd134097a1
3 changed files with 30 additions and 19 deletions
|
@ -236,32 +236,37 @@ class MediaManager(var apiHandler: ApiHandler, var ctx: Context) {
|
|||
serverConfigIdUsed = DeviceManager.serverConnectionConfigId
|
||||
|
||||
loadLibraries { libraries ->
|
||||
val library = libraries[0]
|
||||
Log.d(tag, "Loading categories for library ${library.name} - ${library.id} - ${library.mediaType}")
|
||||
if (libraries.isEmpty()) {
|
||||
Log.w(tag, "No libraries returned from server request")
|
||||
cb(cats) // Return download category only
|
||||
} else {
|
||||
val library = libraries[0]
|
||||
Log.d(tag, "Loading categories for library ${library.name} - ${library.id} - ${library.mediaType}")
|
||||
|
||||
loadLibraryCategories(library.id) { libraryCategories ->
|
||||
loadLibraryCategories(library.id) { libraryCategories ->
|
||||
|
||||
// Only using book or podcast library categories for now
|
||||
libraryCategories.forEach {
|
||||
// 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)
|
||||
// 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}")
|
||||
cats.add(it)
|
||||
}
|
||||
}
|
||||
|
||||
// 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}")
|
||||
cats.add(it)
|
||||
}
|
||||
cb(cats)
|
||||
}
|
||||
|
||||
cb(cats)
|
||||
}
|
||||
}
|
||||
} else { // Not connected/no internet sent downloaded cats only
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<div v-else class="w-full media-item-container overflow-y-auto">
|
||||
<template v-for="mediaItem in localLibraryItems">
|
||||
<nuxt-link :to="`/localMedia/item/${mediaItem.id}`" :key="mediaItem.id" class="flex my-1">
|
||||
<div class="w-12 h-12 bg-primary">
|
||||
<div class="w-12 h-12 min-w-12 min-h-12 bg-primary">
|
||||
<img v-if="mediaItem.coverPathSrc" :src="mediaItem.coverPathSrc" class="w-full h-full object-contain" />
|
||||
</div>
|
||||
<div class="flex-grow px-2">
|
||||
|
|
|
@ -39,6 +39,12 @@ module.exports = {
|
|||
},
|
||||
maxWidth: {
|
||||
'24': '6rem'
|
||||
},
|
||||
minWidth: {
|
||||
'12': '3rem'
|
||||
},
|
||||
minHeight: {
|
||||
'12': '3rem'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue