mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-02-24 00:21:12 +01:00
Resort title-sorted bookshelf after title change
This commit is contained in:
parent
6290cfaeb1
commit
2e8cb46c57
@ -547,6 +547,15 @@ export default {
|
|||||||
if (this.entityName === 'items' || this.entityName === 'series-books') {
|
if (this.entityName === 'items' || this.entityName === 'series-books') {
|
||||||
var indexOf = this.entities.findIndex((ent) => ent && ent.id === libraryItem.id)
|
var indexOf = this.entities.findIndex((ent) => ent && ent.id === libraryItem.id)
|
||||||
if (indexOf >= 0) {
|
if (indexOf >= 0) {
|
||||||
|
if (this.entityName === 'items' && this.orderBy === 'media.metadata.title') {
|
||||||
|
const curTitle = this.entities[indexOf].media.metadata?.title
|
||||||
|
const newTitle = libraryItem.media.metadata?.title
|
||||||
|
if (curTitle != newTitle) {
|
||||||
|
console.log('Title changed. Re-sorting...')
|
||||||
|
this.resetEntities()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
this.entities[indexOf] = libraryItem
|
this.entities[indexOf] = libraryItem
|
||||||
if (this.entityComponentRefs[indexOf]) {
|
if (this.entityComponentRefs[indexOf]) {
|
||||||
this.entityComponentRefs[indexOf].setEntity(libraryItem)
|
this.entityComponentRefs[indexOf].setEntity(libraryItem)
|
||||||
|
Loading…
Reference in New Issue
Block a user