mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-03 10:28:51 +02:00
Update:Sort local books shelf show unfinished books first #302
This commit is contained in:
@@ -56,6 +56,9 @@ export default {
|
||||
},
|
||||
altViewEnabled() {
|
||||
return this.$store.getters['getAltViewEnabled']
|
||||
},
|
||||
localMediaProgress() {
|
||||
return this.$store.state.globals.localMediaProgress
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -69,6 +72,7 @@ export default {
|
||||
var podcasts = []
|
||||
localMedia.forEach((item) => {
|
||||
if (item.mediaType == 'book') {
|
||||
item.progress = this.localMediaProgress.find((lmp) => lmp.id === item.id)
|
||||
books.push(item)
|
||||
} else if (item.mediaType == 'podcast') {
|
||||
podcasts.push(item)
|
||||
@@ -80,7 +84,11 @@ export default {
|
||||
id: 'local-books',
|
||||
label: 'Local Books',
|
||||
type: 'book',
|
||||
entities: books
|
||||
entities: books.sort((a, b) => {
|
||||
if (a.progress && a.progress.isFinished) return 1
|
||||
else if (b.progress && b.progress.isFinished) return -1
|
||||
return 0
|
||||
})
|
||||
})
|
||||
}
|
||||
if (podcasts.length) {
|
||||
|
||||
Reference in New Issue
Block a user