mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-04 01:09:40 +00:00
New data model edit tracks page, match, quick match, clean out old files
This commit is contained in:
parent
be1e1e7ba0
commit
7d66f1eec9
68 changed files with 354 additions and 1529 deletions
|
|
@ -250,11 +250,11 @@ class User {
|
|||
return madeUpdates
|
||||
}
|
||||
|
||||
resetAudiobookProgress(audiobook) {
|
||||
if (!this.audiobooks || !this.audiobooks[audiobook.id]) {
|
||||
resetAudiobookProgress(libraryItem) {
|
||||
if (!this.audiobooks || !this.audiobooks[libraryItem.id]) {
|
||||
return false
|
||||
}
|
||||
return this.updateAudiobookData(audiobook.id, {
|
||||
return this.updateAudiobookData(libraryItem.id, {
|
||||
progress: 0,
|
||||
currentTime: 0,
|
||||
isRead: false,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
const Path = require('path')
|
||||
const Logger = require('../../Logger')
|
||||
const BookMetadata = require('../metadata/BookMetadata')
|
||||
const AudioFile = require('../files/AudioFile')
|
||||
|
|
@ -124,6 +125,27 @@ class Book {
|
|||
return hasUpdates
|
||||
}
|
||||
|
||||
updateAudioTracks(orderedFileData) {
|
||||
var index = 1
|
||||
this.audioFiles = orderedFileData.map((fileData) => {
|
||||
var audioFile = this.audioFiles.find(af => af.ino === fileData.ino)
|
||||
audioFile.manuallyVerified = true
|
||||
audioFile.invalid = false
|
||||
audioFile.error = null
|
||||
if (fileData.exclude !== undefined) {
|
||||
audioFile.exclude = !!fileData.exclude
|
||||
}
|
||||
if (audioFile.exclude) {
|
||||
audioFile.index = -1
|
||||
} else {
|
||||
audioFile.index = index++
|
||||
}
|
||||
return audioFile
|
||||
})
|
||||
|
||||
this.rebuildTracks()
|
||||
}
|
||||
|
||||
updateCover(coverPath) {
|
||||
coverPath = coverPath.replace(/\\/g, '/')
|
||||
if (this.coverPath === coverPath) return false
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ class LibraryFile {
|
|||
this.metadata = fileMetadata
|
||||
this.addedAt = Date.now()
|
||||
this.updatedAt = Date.now()
|
||||
console.log('Library file set from path', path, 'rel path', relPath)
|
||||
}
|
||||
}
|
||||
module.exports = LibraryFile
|
||||
|
|
@ -135,7 +135,7 @@ class BookMetadata {
|
|||
this.title = scanMediaData.title || null
|
||||
this.subtitle = scanMediaData.subtitle || null
|
||||
this.narrators = []
|
||||
this.publishYear = scanMediaData.publishYear || null
|
||||
this.publishedYear = scanMediaData.publishedYear || null
|
||||
this.description = scanMediaData.description || null
|
||||
this.isbn = scanMediaData.isbn || null
|
||||
this.asin = scanMediaData.asin || null
|
||||
|
|
@ -166,7 +166,7 @@ class BookMetadata {
|
|||
},
|
||||
{
|
||||
tag: 'tagDate',
|
||||
key: 'publishYear'
|
||||
key: 'publishedYear'
|
||||
},
|
||||
{
|
||||
tag: 'tagSubtitle',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue