From 069f9855d11e64010ce6cd3a1a60911e93fdbd67 Mon Sep 17 00:00:00 2001 From: TC Date: Sun, 12 Sep 2021 22:17:54 +0200 Subject: [PATCH] nit: fix code style for tuna obs (+ typo) --- plugins/tuna-obs/back.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/plugins/tuna-obs/back.js b/plugins/tuna-obs/back.js index 7e7c1259..d9882e4d 100644 --- a/plugins/tuna-obs/back.js +++ b/plugins/tuna-obs/back.js @@ -1,9 +1,8 @@ - const { ipcRenderer } = require("electron"); -const registerCallback = require("../../providers/song-info"); - const fetch = require('node-fetch'); +const registerCallback = require("../../providers/song-info"); + const post = (data) => { const port = 1608; headers = {'Content-Type': 'application/json', @@ -14,13 +13,10 @@ const post = (data) => { fetch(url, {method: 'POST', headers, body:JSON.stringify({data})}); } - - module.exports = async (win) => { - registerCallback((songInfo) => { - // Register the calilback + // Register the callback if (songInfo.title.length === 0 && songInfo.artist.length === 0) { return; } @@ -33,8 +29,5 @@ module.exports = async (win) => { const artists = [songInfo.artist] const status = !songInfo.isPaused ? 'Playing': 'Paused' post({ cover_url, title, artists, status, progress, duration, album_url}); - }) - } -