apollo/models/session.js

44 lines
694 B
JavaScript
Raw Normal View History

2024-12-04 20:05:58 -05:00
class Session {
constructor(id) {
this._id = id;
this._started = Date.now();
this._current = null;
this._previous = null;
this._lastScrobble = null;
this._pauseDuration = 0;
}
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;
}
get pauseDuration() {
return this._pauseDuration;
}
set pauseDuration(value) {
this._pauseDuration = value;
}
}
module.exports = Session;