aboutsummaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2022-03-19 11:04:20 -0400
committerMax Isom <[email protected]>2022-03-19 11:04:20 -0400
commitbd0e37e0b819bba1248914c03c6a6e17d458e263 (patch)
treeaf245baa3d7771bade967ef16135c12b15db39d0 /src/services
parent46df0875d507ec8e7b1b268f1db5e7925d767d41 (diff)
downloadmuse-bd0e37e0b819bba1248914c03c6a6e17d458e263.tar.xz
muse-bd0e37e0b819bba1248914c03c6a6e17d458e263.zip
Fix lint issue
Diffstat (limited to 'src/services')
-rw-r--r--src/services/player.ts18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/services/player.ts b/src/services/player.ts
index 5c38cdd..bb8180d 100644
--- a/src/services/player.ts
+++ b/src/services/player.ts
@@ -379,6 +379,14 @@ export default class {
this.queue = [];
}
+ move(from: number, to: number): void {
+ if (from > this.queueSize() || to > this.queueSize()) {
+ throw new Error('Move index is outside the range of the queue.');
+ }
+
+ this.queue.splice(this.queuePosition + to, 0, this.queue.splice(this.queuePosition + from, 1)[0]);
+ }
+
private getHashForCache(url: string): string {
return hasha(url);
}
@@ -554,14 +562,4 @@ export default class {
resolve(returnedStream);
});
}
-
- move(from: number, to: number): void {
-
- if (from > this.queueSize() || to > this.queueSize()){
- throw new Error('Move index is outside the range of the queue.' )
- }
-
- this.queue.splice( this.queuePosition + to ,0, this.queue.splice(this.queuePosition + from, 1)[0]);
- }
-
}