mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-11 18:04:53 +02:00
Adding inode to files and audiobooks to support renaming, setting up watcher and removing chokidar
This commit is contained in:
parent
0c1a29adbf
commit
cb40e063da
17 changed files with 558 additions and 234 deletions
|
@ -129,6 +129,18 @@ class Book {
|
|||
return hasUpdates
|
||||
}
|
||||
|
||||
// If audiobook directory path was changed, check and update properties set from dirnames
|
||||
// May be worthwhile checking if these were manually updated and not override manual updates
|
||||
syncPathsUpdated(audiobookData) {
|
||||
var keysToSync = ['author', 'title', 'series', 'publishYear']
|
||||
var syncPayload = {}
|
||||
keysToSync.forEach((key) => {
|
||||
if (audiobookData[key]) syncPayload[key] = audiobookData[key]
|
||||
})
|
||||
if (!Object.keys(syncPayload).length) return false
|
||||
return this.update(syncPayload)
|
||||
}
|
||||
|
||||
isSearchMatch(search) {
|
||||
return this._title.toLowerCase().includes(search) || this._author.toLowerCase().includes(search) || this._series.toLowerCase().includes(search)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue