diff --git a/package.json b/package.json index 47fd869..fe54187 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "category": "Youtube Music" }, { - "command": "ytMusic.playpause", + "command": "ytMusic.playPause", "title": "Toggle Play Pause", "category": "Youtube Music" }, @@ -70,6 +70,16 @@ "command": "ytMusic.cycleRepeat", "title": "Cycle Repeat Mode", "category": "Youtube Music" + }, + { + "command": "ytMusic.thumbsUp", + "title": "Thumbs Up Current Song", + "category": "Youtube Music" + }, + { + "command": "ytMusic.thumbsDown", + "title": "Thumbs Down Current Song", + "category": "Youtube Music" } ], "icons":{ @@ -125,4 +135,4 @@ "socket.io-client": "2.5.0", "vscode-cache": "0.3.0" } -} \ No newline at end of file +} diff --git a/src/extension.ts b/src/extension.ts index 431a615..cd37276 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -4,7 +4,7 @@ import YouTubeMusic from "./youtubeMusic"; export function activate(context: ExtensionContext) { let ytMusic = new YouTubeMusic(context); - const playpauseCommand = commands.registerCommand("ytMusic.playpause", () => { + const playPauseCommand = commands.registerCommand("ytMusic.playPause", () => { ytMusic.togglePlay(); }); const skipCommand = commands.registerCommand("ytMusic.skip", () => { @@ -28,15 +28,18 @@ export function activate(context: ExtensionContext) { ytMusic.auth(); }); - const thumbsUpCommand = commands.registerCommand("ytMusic.thumbsup", () => { + const thumbsUpCommand = commands.registerCommand("ytMusic.thumbsUp", () => { ytMusic.thumbsUp(); }); - const thumbsDownCommand = commands.registerCommand("ytMusic.thumbsdown", () => { - ytMusic.thumbsDown(); - }); + const thumbsDownCommand = commands.registerCommand( + "ytMusic.thumbsDown", + () => { + ytMusic.thumbsDown(); + } + ); - context.subscriptions.push(playpauseCommand); + context.subscriptions.push(playPauseCommand); context.subscriptions.push(skipCommand); context.subscriptions.push(rewindCommand); context.subscriptions.push(restartCommand); diff --git a/src/youtubeMusic.ts b/src/youtubeMusic.ts index 08229d3..f9003c1 100644 --- a/src/youtubeMusic.ts +++ b/src/youtubeMusic.ts @@ -88,9 +88,12 @@ export default class YouTubeMusic { this._repeat = data.player.repeatType; this.updateRepeatButtonState(); this.refreshNowPlaying(); - this.updateDynamicButton("playpause", !this._isPaused); - this.updateDynamicButton("thumbsup", data.player.likeStatus === 'LIKE'); - this.updateDynamicButton("thumbsdown", data.player.likeStatus === 'DISLIKE'); + this.updateDynamicButton("playPause", !this._isPaused); + this.updateDynamicButton("thumbsUp", data.player.likeStatus === "LIKE"); + this.updateDynamicButton( + "thumbsDown", + data.player.likeStatus === "DISLIKE" + ); }); socket.on("reconnect_error", (err) => { @@ -108,7 +111,7 @@ export default class YouTubeMusic { const buttons = [ { id: "rewind", title: "Previous Song", text: "$(chevron-left)" }, { - id: "playpause", + id: "playPause", title: "Play / Pause", text: "$(triangle-right)", dynamicText: (currentlyPlaying: boolean) => @@ -117,19 +120,19 @@ export default class YouTubeMusic { { id: "skip", title: "Next Song", text: "$(chevron-right)" }, { id: "cycleRepeat", title: "Not Repeating", text: "$(sync)" }, { - id: "thumbsdown", + id: "thumbsDown", title: "Thumbs Down", text: "$(mui-thumbs-down)", dynamicText: (isThumbsDown: boolean) => isThumbsDown ? "$(mui-thumbs-down-solid)" : "$(mui-thumbs-down)", }, { - id: "thumbsup", + id: "thumbsUp", title: "Thumbs Up", text: "$(mui-thumbs-up)", dynamicText: (isThumbsUp: boolean) => isThumbsUp ? "$(mui-thumbs-up-solid)" : "$(mui-thumbs-up)", - } + }, ]; buttons.map((button) => {