aqualink 1.7.0-beta2 → 1.7.0-beta3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/structures/Node.js
CHANGED
|
@@ -49,6 +49,10 @@ class Player extends EventEmitter {
|
|
|
49
49
|
return this.previousTracks.length ? this.previousTracks[0] : null;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
get currenttrack() {
|
|
53
|
+
return this.current;
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
addToPreviousTrack(track) {
|
|
53
57
|
if (this.previousTracks.length >= 50) {
|
|
54
58
|
this.previousTracks.pop();
|
|
@@ -102,10 +106,13 @@ class Player extends EventEmitter {
|
|
|
102
106
|
}
|
|
103
107
|
|
|
104
108
|
seek(position) {
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
if (!this.playing) return this;
|
|
110
|
+
const newPosition = this.position + position;
|
|
111
|
+
if (newPosition < 0) {
|
|
112
|
+
throw new Error("Seek position cannot be negative.");
|
|
113
|
+
}
|
|
114
|
+
this.position = newPosition;
|
|
115
|
+
this.updatePlayer({ position: this.position });
|
|
109
116
|
return this;
|
|
110
117
|
}
|
|
111
118
|
|
|
@@ -220,7 +227,6 @@ class Player extends EventEmitter {
|
|
|
220
227
|
try {
|
|
221
228
|
await this.nowPlayingMessage.delete();
|
|
222
229
|
} catch (error) {
|
|
223
|
-
// Consider logging specific errors
|
|
224
230
|
} finally {
|
|
225
231
|
this.nowPlayingMessage = null;
|
|
226
232
|
}
|