mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-16 12:42:06 +00:00
nit: fix code style for tuna obs (+ typo)
This commit is contained in:
@ -1,9 +1,8 @@
|
|||||||
|
|
||||||
const { ipcRenderer } = require("electron");
|
const { ipcRenderer } = require("electron");
|
||||||
const registerCallback = require("../../providers/song-info");
|
|
||||||
|
|
||||||
const fetch = require('node-fetch');
|
const fetch = require('node-fetch');
|
||||||
|
|
||||||
|
const registerCallback = require("../../providers/song-info");
|
||||||
|
|
||||||
const post = (data) => {
|
const post = (data) => {
|
||||||
const port = 1608;
|
const port = 1608;
|
||||||
headers = {'Content-Type': 'application/json',
|
headers = {'Content-Type': 'application/json',
|
||||||
@ -14,13 +13,10 @@ const post = (data) => {
|
|||||||
fetch(url, {method: 'POST', headers, body:JSON.stringify({data})});
|
fetch(url, {method: 'POST', headers, body:JSON.stringify({data})});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = async (win) => {
|
module.exports = async (win) => {
|
||||||
|
|
||||||
registerCallback((songInfo) => {
|
registerCallback((songInfo) => {
|
||||||
|
|
||||||
// Register the calilback
|
// Register the callback
|
||||||
if (songInfo.title.length === 0 && songInfo.artist.length === 0) {
|
if (songInfo.title.length === 0 && songInfo.artist.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -33,8 +29,5 @@ module.exports = async (win) => {
|
|||||||
const artists = [songInfo.artist]
|
const artists = [songInfo.artist]
|
||||||
const status = !songInfo.isPaused ? 'Playing': 'Paused'
|
const status = !songInfo.isPaused ? 'Playing': 'Paused'
|
||||||
post({ cover_url, title, artists, status, progress, duration, album_url});
|
post({ cover_url, title, artists, status, progress, duration, album_url});
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user