mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-10 03:55:29 +01:00
Fix lint issue
This commit is contained in:
parent
46df0875d5
commit
bd0e37e0b8
|
@ -37,7 +37,7 @@ export default class implements Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (to < 1) {
|
if (to < 1) {
|
||||||
throw new Error('position must be at least 1')
|
throw new Error('position must be at least 1');
|
||||||
}
|
}
|
||||||
|
|
||||||
player.move(from, to);
|
player.move(from, to);
|
||||||
|
|
|
@ -21,7 +21,7 @@ import Config from './commands/config.js';
|
||||||
import Disconnect from './commands/disconnect.js';
|
import Disconnect from './commands/disconnect.js';
|
||||||
import Favorites from './commands/favorites.js';
|
import Favorites from './commands/favorites.js';
|
||||||
import ForwardSeek from './commands/fseek.js';
|
import ForwardSeek from './commands/fseek.js';
|
||||||
import Move from './commands/move.js'
|
import Move from './commands/move.js';
|
||||||
import NowPlaying from './commands/now-playing.js';
|
import NowPlaying from './commands/now-playing.js';
|
||||||
import Pause from './commands/pause.js';
|
import Pause from './commands/pause.js';
|
||||||
import Play from './commands/play.js';
|
import Play from './commands/play.js';
|
||||||
|
|
|
@ -379,6 +379,14 @@ export default class {
|
||||||
this.queue = [];
|
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 {
|
private getHashForCache(url: string): string {
|
||||||
return hasha(url);
|
return hasha(url);
|
||||||
}
|
}
|
||||||
|
@ -554,14 +562,4 @@ export default class {
|
||||||
resolve(returnedStream);
|
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…
Reference in a new issue