diff options
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/player.ts | 18 |
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]); - } - } |
