diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue index 24f2cc86..d3ff4a77 100644 --- a/client/components/cards/LazyBookCard.vue +++ b/client/components/cards/LazyBookCard.vue @@ -256,8 +256,9 @@ export default { if (this.orderBy === 'mtimeMs') return 'Modified ' + this.$formatDate(this._libraryItem.mtimeMs) if (this.orderBy === 'birthtimeMs') return 'Born ' + this.$formatDate(this._libraryItem.birthtimeMs) if (this.orderBy === 'addedAt') return 'Added ' + this.$formatDate(this._libraryItem.addedAt) - if (this.orderBy === 'duration') return 'Duration: ' + this.$elapsedPrettyExtended(this.media.duration, false) + if (this.orderBy === 'media.duration') return 'Duration: ' + this.$elapsedPrettyExtended(this.media.duration, false) if (this.orderBy === 'size') return 'Size: ' + this.$bytesPretty(this._libraryItem.size) + if (this.orderBy === 'media.numTracks') return `${this.numEpisodes} Episodes` return null }, episodeProgress() { diff --git a/client/components/controls/OrderSelect.vue b/client/components/controls/OrderSelect.vue index 47e5f335..c22ce595 100644 --- a/client/components/controls/OrderSelect.vue +++ b/client/components/controls/OrderSelect.vue @@ -52,6 +52,10 @@ export default { text: 'Size', value: 'size' }, + { + text: 'Duration', + value: 'media.duration' + }, { text: 'File Birthtime', value: 'birthtimeMs' @@ -78,6 +82,10 @@ export default { text: 'Size', value: 'size' }, + { + text: '# of Episodes', + value: 'media.numTracks' + }, { text: 'File Birthtime', value: 'birthtimeMs' diff --git a/client/store/user.js b/client/store/user.js index 9cfb0a62..9913c684 100644 --- a/client/store/user.js +++ b/client/store/user.js @@ -72,6 +72,9 @@ export const actions = { if (state.settings.orderBy == 'media.metadata.authorName' || state.settings.orderBy == 'media.metadata.authorNameLF') { settingsUpdate.orderBy = 'media.metadata.author' } + if (state.settings.orderBy == 'media.duration') { + settingsUpdate.orderBy = 'media.numTracks' + } var invalidFilters = ['series', 'authors', 'narrators', 'languages', 'progress', 'issues'] var filterByFirstPart = (state.settings.filterBy || '').split('.').shift() if (invalidFilters.includes(filterByFirstPart)) { @@ -81,6 +84,9 @@ export const actions = { if (state.settings.orderBy == 'media.metadata.author') { settingsUpdate.orderBy = 'media.metadata.authorName' } + if (state.settings.orderBy == 'media.numTracks') { + settingsUpdate.orderBy = 'media.duration' + } } if (Object.keys(settingsUpdate).length) { dispatch('updateUserSettings', settingsUpdate)