apollo/models/session.js
2024-12-05 08:27:45 +00:00

47 lines
717 B
JavaScript

class Session {
#id = null;
#started = null;
#current = null;
#lastScrobble = null;
#pauseDuration = 0;
constructor(id) {
this.#id = id;
this.#started = Date.now();
}
get id() {
return this.#id;
}
get playing() {
return this.#current;
}
set playing(value) {
console.log('playing =', value);
this.#current = value;
}
get started() {
return this.#started;
}
get lastScrobbleTimestamp() {
return this.#lastScrobble;
}
set lastScrobbleTimestamp(value) {
this.#lastScrobble = value;
}
get pauseDuration() {
return this.#pauseDuration;
}
set pauseDuration(value) {
this.#pauseDuration = value;
}
}
module.exports = Session;