mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 02:31:45 +00:00
lint
This commit is contained in:
@ -45,9 +45,11 @@ function handle(win) {
|
||||
ipcMain.on("add-metadata", async (event, filePath, songBuffer, currentMetadata) => {
|
||||
let fileBuffer = songBuffer;
|
||||
const songMetadata = { ...metadata, ...currentMetadata };
|
||||
|
||||
if (!songMetadata.image && songMetadata.imageSrc) {
|
||||
songMetadata.image = await getImage(songMetadata.imageSrc)
|
||||
}
|
||||
|
||||
try {
|
||||
const coverBuffer = songMetadata.image.toPNG();
|
||||
const writer = new ID3Writer(songBuffer);
|
||||
|
||||
@ -47,8 +47,8 @@ global.download = () => {
|
||||
videoUrl = baseUrl + "/" + videoUrl;
|
||||
metadata = null;
|
||||
} else {
|
||||
videoUrl = global.songInfo.url || window.location.href;
|
||||
metadata = global.songInfo;
|
||||
videoUrl = metadata.url || window.location.href;
|
||||
}
|
||||
|
||||
downloadVideoToMP3(
|
||||
|
||||
@ -152,7 +152,7 @@ const toMP3 = async (
|
||||
ipcRenderer.send("add-metadata", filePath, fileBuffer, {
|
||||
artist: metadata.artist,
|
||||
title: metadata.title,
|
||||
imageSrc: metadata.imageSrc || ""
|
||||
imageSrc: metadata.imageSrc
|
||||
});
|
||||
ipcRenderer.once("add-metadata-done", reinit);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user