2024-12-04 20:05:58 -05:00
|
|
|
class Session {
|
2024-12-05 03:27:45 -05:00
|
|
|
#id = null;
|
|
|
|
#started = null;
|
|
|
|
#current = null;
|
2024-12-05 13:52:36 -05:00
|
|
|
lastScrobbleTimestamp = 0;
|
|
|
|
lastUpdateTimestamp = 0;
|
2024-12-05 12:32:37 -05:00
|
|
|
pauseDuration = 0;
|
|
|
|
playDuration = 0;
|
2024-12-05 03:27:45 -05:00
|
|
|
|
2024-12-04 20:05:58 -05:00
|
|
|
constructor(id) {
|
2024-12-05 03:27:45 -05:00
|
|
|
this.#id = id;
|
|
|
|
this.#started = Date.now();
|
2024-12-04 20:05:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
get id() {
|
2024-12-05 03:27:45 -05:00
|
|
|
return this.#id;
|
2024-12-04 20:05:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
get playing() {
|
2024-12-05 03:27:45 -05:00
|
|
|
return this.#current;
|
2024-12-04 20:05:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
set playing(value) {
|
2024-12-05 03:27:45 -05:00
|
|
|
this.#current = value;
|
2024-12-04 20:05:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
get started() {
|
2024-12-05 03:27:45 -05:00
|
|
|
return this.#started;
|
2024-12-04 20:05:58 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Session;
|