setup SongInfo **once**

This commit is contained in:
Araxeus
2021-05-10 04:15:56 +03:00
parent 7942efa202
commit 7cf78c6635
8 changed files with 20 additions and 26 deletions

View File

@ -2,7 +2,7 @@ const fetch = require('node-fetch');
const md5 = require('md5');
const { shell } = require('electron');
const { setOptions } = require('../../config/plugins');
const getSongInfo = require('../../providers/song-info');
const registerCallback = require('../../providers/song-info');
const defaultConfig = require('../../config/defaults');
const createFormData = params => {
@ -128,9 +128,7 @@ const setNowPlaying = (songInfo, config) => {
// this will store the timeout that will trigger addScrobble
let scrobbleTimer = undefined;
const lastfm = async (win, config) => {
const registerCallback = getSongInfo(win);
const lastfm = async (_win, config) => {
if (!config.api_root) {
// settings are not present, creating them with the default values
config = defaultConfig.plugins['last-fm'];