diff --git a/models/session.js b/models/session.js index a129cf6..c6212bc 100644 --- a/models/session.js +++ b/models/session.js @@ -1,43 +1,46 @@ class Session { + #id = null; + #started = null; + #current = null; + #lastScrobble = null; + #pauseDuration = 0; + constructor(id) { - this._id = id; - this._started = Date.now(); - this._current = null; - this._previous = null; - this._lastScrobble = null; - this._pauseDuration = 0; + this.#id = id; + this.#started = Date.now(); } get id() { - return this._id; + return this.#id; } get playing() { - return this._current; + return this.#current; } set playing(value) { - this._current = value; + console.log('playing =', value); + this.#current = value; } get started() { - return this._started; + return this.#started; } get lastScrobbleTimestamp() { - return this._lastScrobble; + return this.#lastScrobble; } set lastScrobbleTimestamp(value) { - this._lastScrobble = value; + this.#lastScrobble = value; } get pauseDuration() { - return this._pauseDuration; + return this.#pauseDuration; } set pauseDuration(value) { - this._pauseDuration = value; + this.#pauseDuration = value; } }