From 3cc288e0145eefd11818806927c78905e12f969b Mon Sep 17 00:00:00 2001 From: Marie <8841466+Mar0xy@users.noreply.github.com> Date: Wed, 21 Apr 2021 04:44:44 +0200 Subject: [PATCH] Fix URL fetching --- src/preload.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/preload.js b/src/preload.js index b85e49b..3d80b51 100644 --- a/src/preload.js +++ b/src/preload.js @@ -250,7 +250,6 @@ function updateMediaInfo(options, notify) { */ setInterval(function () { const title = elements.getText("title"); - //const id = elements.get("url").href.replace(/[^0-9]/g, ""); const artists = elements.getText("artists"); const current = elements.getText("current"); const duration = elements.getText("duration"); @@ -285,12 +284,12 @@ setInterval(function () { } // Video/Song check if it's a video return URL as undefined due to it not having an id. - switch(elements.get("url")) { + switch(elements.get("title").querySelector("a")) { case null: currentURL = undefined; break; default: - const id = elements.get("url").href.replace(/[^0-9]/g, ""); + const id = elements.get("title").querySelector("a").href.replace(/[^0-9]/g, ""); currentURL = `https://tidal.com/browse/track/${id}`; break; }