mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Update:Show publishedYear below book cards instead of author name
This commit is contained in:
		
							parent
							
								
									7f27eabf3e
								
							
						
					
					
						commit
						0137f6dfeb
					
				| @ -6,11 +6,11 @@ | ||||
|     </div> | ||||
| 
 | ||||
|     <!-- Alternative bookshelf title/author/sort --> | ||||
|     <div v-if="isAlternativeBookshelfView" class="absolute left-0 z-50 w-full" :style="{ bottom: `-${titleDisplayBottomOffset}rem` }"> | ||||
|     <div v-if="isAlternativeBookshelfView || isAuthorBookshelfView" class="absolute left-0 z-50 w-full" :style="{ bottom: `-${titleDisplayBottomOffset}rem` }"> | ||||
|       <p class="truncate" :style="{ fontSize: 0.9 * sizeMultiplier + 'rem' }"> | ||||
|         {{ displayTitle }} | ||||
|       </p> | ||||
|       <p class="truncate text-gray-400" :style="{ fontSize: 0.8 * sizeMultiplier + 'rem' }">{{ displayAuthor || ' ' }}</p> | ||||
|       <p class="truncate text-gray-400" :style="{ fontSize: 0.8 * sizeMultiplier + 'rem' }">{{ displayLineTwo || ' ' }}</p> | ||||
|       <p v-if="displaySortLine" class="truncate text-gray-400" :style="{ fontSize: 0.8 * sizeMultiplier + 'rem' }">{{ displaySortLine }}</p> | ||||
|     </div> | ||||
| 
 | ||||
| @ -247,8 +247,11 @@ export default { | ||||
|       } | ||||
|       return this.title | ||||
|     }, | ||||
|     displayAuthor() { | ||||
|     displayLineTwo() { | ||||
|       if (this.isPodcast) return this.author | ||||
|       if (this.isAuthorBookshelfView) { | ||||
|         return this.mediaMetadata.publishedYear || '' | ||||
|       } | ||||
|       if (this.orderBy === 'media.metadata.authorNameLF') return this.authorLF | ||||
|       return this.author | ||||
|     }, | ||||
| @ -424,8 +427,12 @@ export default { | ||||
|       var constants = this.$constants || this.$nuxt.$constants | ||||
|       return this.bookshelfView === constants.BookshelfView.TITLES | ||||
|     }, | ||||
|     isAuthorBookshelfView() { | ||||
|       var constants = this.$constants || this.$nuxt.$constants | ||||
|       return this.bookshelfView === constants.BookshelfView.AUTHOR | ||||
|     }, | ||||
|     titleDisplayBottomOffset() { | ||||
|       if (!this.isAlternativeBookshelfView) return 0 | ||||
|       if (!this.isAlternativeBookshelfView && !this.isAuthorBookshelfView) return 0 | ||||
|       else if (!this.displaySortLine) return 3 * this.sizeMultiplier | ||||
|       return 4.25 * this.sizeMultiplier | ||||
|     } | ||||
|  | ||||
| @ -13,7 +13,7 @@ | ||||
|     <div ref="slider" class="w-full overflow-y-hidden overflow-x-auto no-scroll -mx-2" style="scroll-behavior: smooth" @scroll="scrolled"> | ||||
|       <div class="flex" :style="{ height: height + 'px' }"> | ||||
|         <template v-for="(item, index) in items"> | ||||
|           <cards-lazy-book-card :key="item.id" :ref="`slider-item-${item.id}`" :index="index" :book-mount="item" :height="cardHeight" :width="cardWidth" :book-cover-aspect-ratio="bookCoverAspectRatio" :bookshelf-view="$constants.BookshelfView.TITLES" class="relative mx-2" @edit="editItem" @select="selectItem" /> | ||||
|           <cards-lazy-book-card :key="item.id" :ref="`slider-item-${item.id}`" :index="index" :book-mount="item" :height="cardHeight" :width="cardWidth" :book-cover-aspect-ratio="bookCoverAspectRatio" :bookshelf-view="$constants.BookshelfView.AUTHOR" class="relative mx-2" @edit="editItem" @select="selectItem" /> | ||||
|         </template> | ||||
|       </div> | ||||
|     </div> | ||||
|  | ||||
| @ -21,7 +21,8 @@ const BookCoverAspectRatio = { | ||||
| 
 | ||||
| const BookshelfView = { | ||||
|   STANDARD: 0, | ||||
|   TITLES: 1 | ||||
|   TITLES: 1, | ||||
|   AUTHOR: 2 // Books shown on author page
 | ||||
| } | ||||
| 
 | ||||
| const PlayMethod = { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user