Update:Remove unused missing/invalid audiobook parts logic and keys

This commit is contained in:
advplyr 2024-03-21 14:38:52 -05:00
parent 8d7530254c
commit ff5226fa93
33 changed files with 19 additions and 190 deletions

View file

@ -17,7 +17,6 @@ class Book {
this.audioFiles = []
this.chapters = []
this.missingParts = []
this.ebookFile = null
this.lastCoverSearch = null
@ -36,7 +35,6 @@ class Book {
this.tags = [...book.tags]
this.audioFiles = book.audioFiles.map(f => new AudioFile(f))
this.chapters = book.chapters.map(c => ({ ...c }))
this.missingParts = book.missingParts ? [...book.missingParts] : []
this.ebookFile = book.ebookFile ? new EBookFile(book.ebookFile) : null
this.lastCoverSearch = book.lastCoverSearch || null
this.lastCoverSearchQuery = book.lastCoverSearchQuery || null
@ -51,7 +49,6 @@ class Book {
tags: [...this.tags],
audioFiles: this.audioFiles.map(f => f.toJSON()),
chapters: this.chapters.map(c => ({ ...c })),
missingParts: [...this.missingParts],
ebookFile: this.ebookFile ? this.ebookFile.toJSON() : null
}
}
@ -65,8 +62,6 @@ class Book {
numTracks: this.tracks.length,
numAudioFiles: this.audioFiles.length,
numChapters: this.chapters.length,
numMissingParts: this.missingParts.length,
numInvalidAudioFiles: this.invalidAudioFiles.length,
duration: this.duration,
size: this.size,
ebookFormat: this.ebookFile?.ebookFormat
@ -85,7 +80,6 @@ class Book {
duration: this.duration,
size: this.size,
tracks: this.tracks.map(t => t.toJSON()),
missingParts: [...this.missingParts],
ebookFile: this.ebookFile?.toJSON() || null
}
}
@ -109,11 +103,8 @@ class Book {
get hasMediaEntities() {
return !!this.tracks.length || this.ebookFile
}
get invalidAudioFiles() {
return this.audioFiles.filter(af => af.invalid)
}
get includedAudioFiles() {
return this.audioFiles.filter(af => !af.exclude && !af.invalid)
return this.audioFiles.filter(af => !af.exclude)
}
get tracks() {
let startOffset = 0
@ -238,7 +229,6 @@ class Book {
this.audioFiles = orderedFileData.map((fileData) => {
const 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
@ -257,7 +247,6 @@ class Book {
rebuildTracks() {
Logger.debug(`[Book] Tracks being rebuilt...!`)
this.audioFiles.sort((a, b) => a.index - b.index)
this.missingParts = []
}
// Only checks container format