aboutsummaryrefslogtreecommitdiff
path: root/src
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
parent46df0875d507ec8e7b1b268f1db5e7925d767d41 (diff)
downloadmuse-bd0e37e0b819bba1248914c03c6a6e17d458e263.tar.xz
muse-bd0e37e0b819bba1248914c03c6a6e17d458e263.zip
Fix lint issue
Diffstat (limited to 'src')
-rw-r--r--src/commands/move.ts4
-rw-r--r--src/inversify.config.ts2
-rw-r--r--src/services/player.ts18
3 files changed, 11 insertions, 13 deletions
diff --git a/src/commands/move.ts b/src/commands/move.ts
index 91a3957..731e0da 100644
--- a/src/commands/move.ts
+++ b/src/commands/move.ts
@@ -19,7 +19,7 @@ export default class implements Command {
option.setName('to')
.setDescription('position to move the song to')
.setRequired(true));
-
+
private readonly playerManager: PlayerManager;
constructor(@inject(TYPES.Managers.Player) playerManager: PlayerManager) {
@@ -37,7 +37,7 @@ export default class implements Command {
}
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);
diff --git a/src/inversify.config.ts b/src/inversify.config.ts
index 5574bb0..2119b98 100644
--- a/src/inversify.config.ts
+++ b/src/inversify.config.ts
@@ -21,7 +21,7 @@ import Config from './commands/config.js';
import Disconnect from './commands/disconnect.js';
import Favorites from './commands/favorites.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 Pause from './commands/pause.js';
import Play from './commands/play.js';
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]);
- }
-
}