mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 09:44:41 +02:00
Add:Sort by duration for audiobooks and sort by number of episodes for podcasts #558
This commit is contained in:
parent
db48a486e5
commit
55c40658f2
3 changed files with 16 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue