From f1ddb928864bbb954b74e477cecc24d1a024b287 Mon Sep 17 00:00:00 2001 From: TC Date: Tue, 12 Jan 2021 21:16:29 +0100 Subject: [PATCH] nit: prettier --- plugins/notifications/back.js | 8 ++++---- plugins/touchbar/back.js | 34 ++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/plugins/notifications/back.js b/plugins/notifications/back.js index ac5e6660..a55bffe4 100644 --- a/plugins/notifications/back.js +++ b/plugins/notifications/back.js @@ -1,18 +1,18 @@ -const {Notification} = require('electron'); +const { Notification } = require("electron"); const notify = info => { let notificationImage = 'assets/youtube-music.png'; if (info.image) { - notificationImage = info.image.resize({height: 256, width: 256}); + notificationImage = info.image.resize({ height: 256, width: 256 }); } // Fill the notification with content const notification = { - title: info.title || 'Playing', + title: info.title || "Playing", body: info.artist, icon: notificationImage, - silent: true + silent: true, }; // Send the notification new Notification(notification).show(); diff --git a/plugins/touchbar/back.js b/plugins/touchbar/back.js index 5e0a41bf..5eeba67f 100644 --- a/plugins/touchbar/back.js +++ b/plugins/touchbar/back.js @@ -1,15 +1,15 @@ -const {TouchBar} = require('electron'); +const { TouchBar } = require("electron"); const { TouchBarButton, TouchBarLabel, TouchBarSpacer, TouchBarSegmentedControl, - TouchBarScrubber + TouchBarScrubber, } = TouchBar; // Songtitle label const songTitle = new TouchBarLabel({ - label: '' + label: "", }); // This will store the song controls once available let controls = []; @@ -22,23 +22,23 @@ const pausePlayButton = new TouchBarButton(); // The song control buttons (control functions are in the same order) const buttons = new TouchBarSegmentedControl({ - mode: 'buttons', + mode: "buttons", segments: [ new TouchBarButton({ - label: '⏮' + label: "⏮", }), pausePlayButton, new TouchBarButton({ - label: '⏭' + label: "⏭", }), new TouchBarButton({ - label: '👎' + label: "👎", }), new TouchBarButton({ - label: '👍' - }) + label: "👍", + }), ], - change: i => controls[i]() + change: (i) => controls[i](), }); // This is the touchbar object, this combines everything with proper layout @@ -46,13 +46,13 @@ const touchBar = new TouchBar({ items: [ new TouchBarScrubber({ items: [songImage, songTitle], - continuous: false + continuous: false, }), new TouchBarSpacer({ - size: 'flexible' + size: "flexible", }), - buttons - ] + buttons, + ], }); module.exports = win => { @@ -74,10 +74,12 @@ module.exports = win => { songTitle.label = songInfo.title; // Changes the pause button if paused - pausePlayButton.label = songInfo.isPaused ? '▶️' : '⏸'; + pausePlayButton.label = songInfo.isPaused ? "▶️" : "⏸"; // Get image source - songImage.icon = songInfo.image ? songInfo.image.resize({height: 23}) : null; + songImage.icon = songInfo.image + ? songInfo.image.resize({ height: 23 }) + : null; win.setTouchBar(touchBar); });