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

@ -40,7 +40,7 @@ class Author {
}
toJSONExpanded(numBooks = 0) {
var json = this.toJSON()
const json = this.toJSON()
json.numBooks = numBooks
return json
}
@ -63,11 +63,11 @@ class Author {
}
update(payload) {
var json = this.toJSON()
const json = this.toJSON()
delete json.id
delete json.addedAt
delete json.updatedAt
var hasUpdates = false
let hasUpdates = false
for (const key in json) {
if (payload[key] !== undefined && json[key] != payload[key]) {
this[key] = payload[key]

View file

@ -92,7 +92,7 @@ class PodcastEpisode {
}
get audioTrack() {
var audioTrack = new AudioTrack()
const audioTrack = new AudioTrack()
audioTrack.setData(this.libraryItemId, this.audioFile, 0)
return audioTrack
}
@ -133,7 +133,7 @@ class PodcastEpisode {
}
update(payload) {
var hasUpdates = false
let hasUpdates = false
for (const key in this.toJSON()) {
if (payload[key] != undefined && payload[key] != this[key]) {
this[key] = payload[key]

View file

@ -50,7 +50,7 @@ class Series {
update(series) {
if (!series) return false
const keysToUpdate = ['name', 'description']
var hasUpdated = false
let hasUpdated = false
for (const key of keysToUpdate) {
if (series[key] !== undefined && series[key] !== this[key]) {
this[key] = series[key]