apollo/models/session.js

32 lines
461 B
JavaScript
Raw Permalink Normal View History

2024-12-04 20:05:58 -05:00
class Session {
2024-12-05 03:27:45 -05:00
#id = null;
#started = null;
#current = null;
lastScrobbleTimestamp = 0;
lastUpdateTimestamp = 0;
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;