39 lines
571 B
JavaScript
39 lines
571 B
JavaScript
class Session {
|
|
#id = null;
|
|
#started = null;
|
|
#current = null;
|
|
#lastScrobble = null;
|
|
pauseDuration = 0;
|
|
playDuration = 0;
|
|
|
|
constructor(id) {
|
|
this.#id = id;
|
|
this.#started = Date.now();
|
|
}
|
|
|
|
get id() {
|
|
return this.#id;
|
|
}
|
|
|
|
get playing() {
|
|
return this.#current;
|
|
}
|
|
|
|
set playing(value) {
|
|
this.#current = value;
|
|
}
|
|
|
|
get started() {
|
|
return this.#started;
|
|
}
|
|
|
|
get lastScrobbleTimestamp() {
|
|
return this.#lastScrobble;
|
|
}
|
|
|
|
set lastScrobbleTimestamp(value) {
|
|
this.#lastScrobble = value;
|
|
}
|
|
}
|
|
|
|
module.exports = Session; |