mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-10 05:49:37 +00:00
Update:Remove unused missing/invalid audiobook parts logic and keys
This commit is contained in:
parent
8d7530254c
commit
ff5226fa93
33 changed files with 19 additions and 190 deletions
|
|
@ -32,7 +32,6 @@ class AudioFile {
|
|||
this.metaTags = null
|
||||
|
||||
this.manuallyVerified = false
|
||||
this.invalid = false
|
||||
this.exclude = false
|
||||
this.error = null
|
||||
|
||||
|
|
@ -53,7 +52,6 @@ class AudioFile {
|
|||
trackNumFromFilename: this.trackNumFromFilename,
|
||||
discNumFromFilename: this.discNumFromFilename,
|
||||
manuallyVerified: !!this.manuallyVerified,
|
||||
invalid: !!this.invalid,
|
||||
exclude: !!this.exclude,
|
||||
error: this.error || null,
|
||||
format: this.format,
|
||||
|
|
@ -78,7 +76,6 @@ class AudioFile {
|
|||
this.addedAt = data.addedAt
|
||||
this.updatedAt = data.updatedAt
|
||||
this.manuallyVerified = !!data.manuallyVerified
|
||||
this.invalid = !!data.invalid
|
||||
this.exclude = !!data.exclude
|
||||
this.error = data.error || null
|
||||
|
||||
|
|
@ -112,10 +109,6 @@ class AudioFile {
|
|||
}
|
||||
}
|
||||
|
||||
get isValidTrack() {
|
||||
return !this.invalid && !this.exclude
|
||||
}
|
||||
|
||||
// New scanner creates AudioFile from AudioFileScanner
|
||||
setDataFromProbe(libraryFile, probeData) {
|
||||
this.ino = libraryFile.ino || null
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue