mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
Bundle imports + prettier
This commit is contained in:
@ -1,12 +1,10 @@
|
|||||||
const { ipcMain } = require("electron");
|
const { ipcMain, nativeImage } = require("electron");
|
||||||
const { nativeImage } = require("electron");
|
|
||||||
|
|
||||||
const fetch = require("node-fetch");
|
const fetch = require("node-fetch");
|
||||||
|
|
||||||
// This selects the progress bar, used for current progress
|
// This selects the progress bar, used for current progress
|
||||||
const progressSelector = "#progress-bar";
|
const progressSelector = "#progress-bar";
|
||||||
|
|
||||||
|
|
||||||
// Grab the progress using the selector
|
// Grab the progress using the selector
|
||||||
const getProgress = async (win) => {
|
const getProgress = async (win) => {
|
||||||
// Get current value of the progressbar element
|
// Get current value of the progressbar element
|
||||||
@ -52,7 +50,7 @@ const handleData = async (_event, responseText) => {
|
|||||||
songInfo.songDuration = data?.videoDetails?.lengthSeconds;
|
songInfo.songDuration = data?.videoDetails?.lengthSeconds;
|
||||||
songInfo.image = await getImage(songInfo.imageSrc);
|
songInfo.image = await getImage(songInfo.imageSrc);
|
||||||
songInfo.uploadDate = data?.microformat?.microformatDataRenderer?.uploadDate;
|
songInfo.uploadDate = data?.microformat?.microformatDataRenderer?.uploadDate;
|
||||||
}
|
};
|
||||||
|
|
||||||
const registerProvider = (win) => {
|
const registerProvider = (win) => {
|
||||||
// This variable will be filled with the callbacks once they register
|
// This variable will be filled with the callbacks once they register
|
||||||
@ -77,7 +75,7 @@ const registerProvider = (win) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// This will be called when the song-info-front finds a new request with song data
|
// This will be called when the song-info-front finds a new request with song data
|
||||||
ipcMain.on('song-info-request', handleData);
|
ipcMain.on("song-info-request", handleData);
|
||||||
|
|
||||||
return registerCallback;
|
return registerCallback;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user