set resume on start url to songInfo.url

This commit is contained in:
Araxeus
2021-10-24 21:17:45 +03:00
parent a47c906ab2
commit 43a9093eb7
2 changed files with 5 additions and 7 deletions

View File

@ -2,6 +2,8 @@ const { ipcMain, nativeImage } = require("electron");
const fetch = require("node-fetch");
const config = require("../config");
// Grab the progress using the selector
const getProgress = async (win) => {
// Get current value of the progressbar element
@ -56,6 +58,9 @@ const handleData = async (responseText, win) => {
songInfo.uploadDate = data?.microformat?.microformatDataRenderer?.uploadDate;
songInfo.url = data?.microformat?.microformatDataRenderer?.urlCanonical?.split("&")[0];
// used for options.resumeOnStart
config.set("url", data?.microformat?.microformatDataRenderer?.urlCanonical);
win.webContents.send("update-song-info", JSON.stringify(songInfo));
};