mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-06-28 01:32:42 +02:00
added move command (#585)
Co-authored-by: Max Isom <codetheweb@users.noreply.github.com>
This commit is contained in:
parent
60376d4f57
commit
46df0875d5
4 changed files with 60 additions and 0 deletions
|
@ -554,4 +554,14 @@ 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]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue