Cleanup and remove more vars

This commit is contained in:
advplyr 2022-12-26 16:08:53 -06:00
parent 45c9038954
commit 775dedc338
5 changed files with 18 additions and 33 deletions

View file

@ -102,7 +102,7 @@ class AudioFile {
}
get mimeType() {
var format = this.metadata.format.toUpperCase()
const format = this.metadata.format.toUpperCase()
if (AudioMimeType[format]) {
return AudioMimeType[format]
} else {
@ -147,7 +147,7 @@ class AudioFile {
return false
}
var hasUpdates = false
let hasUpdates = false
for (let i = 0; i < updatedChapters.length; i++) {
if (JSON.stringify(updatedChapters[i]) !== JSON.stringify(this.chapters[i])) {
hasUpdates = true
@ -163,25 +163,10 @@ class AudioFile {
return new AudioFile(this.toJSON())
}
// If the file or parent directory was renamed it is synced here
syncFile(newFile) {
// TODO: Sync file would update the file info if needed
return false
// var hasUpdates = false
// var keysToSync = ['path', 'relPath', 'ext', 'filename']
// keysToSync.forEach((key) => {
// if (newFile[key] !== undefined && newFile[key] !== this[key]) {
// hasUpdates = true
// this[key] = newFile[key]
// }
// })
// return hasUpdates
}
updateFromScan(scannedAudioFile) {
var hasUpdated = false
let hasUpdated = false
var newjson = scannedAudioFile.toJSON()
const newjson = scannedAudioFile.toJSON()
if (this.manuallyVerified) newjson.manuallyVerified = true
if (this.exclude) newjson.exclude = true
newjson.addedAt = this.addedAt