mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Update:Collections page show total duration
This commit is contained in:
		
							parent
							
								
									513d946faa
								
							
						
					
					
						commit
						2cb4f972d7
					
				@ -7,7 +7,7 @@
 | 
				
			|||||||
        <span class="text-xs md:text-sm font-mono leading-none">{{ books.length }}</span>
 | 
					        <span class="text-xs md:text-sm font-mono leading-none">{{ books.length }}</span>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
      <div class="flex-grow" />
 | 
					      <div class="flex-grow" />
 | 
				
			||||||
      <!-- <p v-if="totalDuration">{{ totalDurationPretty }}</p> -->
 | 
					      <p v-if="totalDuration" class="text-sm text-gray-200">{{ totalDurationPretty }}</p>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <draggable v-model="booksCopy" v-bind="dragOptions" class="list-group" handle=".drag-handle" draggable=".item" tag="div" @start="drag = true" @end="drag = false" @update="draggableUpdate">
 | 
					    <draggable v-model="booksCopy" v-bind="dragOptions" class="list-group" handle=".drag-handle" draggable=".item" tag="div" @start="drag = true" @end="drag = false" @update="draggableUpdate">
 | 
				
			||||||
      <transition-group type="transition" :name="!drag ? 'collection-book' : null">
 | 
					      <transition-group type="transition" :name="!drag ? 'collection-book' : null">
 | 
				
			||||||
@ -57,6 +57,16 @@ export default {
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
    bookCoverAspectRatio() {
 | 
					    bookCoverAspectRatio() {
 | 
				
			||||||
      return this.coverAspectRatio === this.$constants.BookCoverAspectRatio.SQUARE ? 1 : 1.6
 | 
					      return this.coverAspectRatio === this.$constants.BookCoverAspectRatio.SQUARE ? 1 : 1.6
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    totalDuration() {
 | 
				
			||||||
 | 
					      var _total = 0
 | 
				
			||||||
 | 
					      this.books.forEach((book) => {
 | 
				
			||||||
 | 
					        _total += book.media.duration
 | 
				
			||||||
 | 
					      })
 | 
				
			||||||
 | 
					      return _total
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    totalDurationPretty() {
 | 
				
			||||||
 | 
					      return this.$elapsedPrettyExtended(this.totalDuration)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user