44 lines
694 B
JavaScript
44 lines
694 B
JavaScript
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; |