From 4208a0001f41cc5dbc65ea7658f0cf4811ddb384 Mon Sep 17 00:00:00 2001 From: Julien Maille Date: Wed, 13 Oct 2021 22:40:51 +0200 Subject: [PATCH] WIP: #63 better handling of advertisements --- dribbblish-dynamic.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dribbblish-dynamic.js b/dribbblish-dynamic.js index 203ad2d..1cfbd42 100644 --- a/dribbblish-dynamic.js +++ b/dribbblish-dynamic.js @@ -362,6 +362,11 @@ async function songchange() { } else if (Spicetify.Player.data.track.metadata.is_local=="true") { // local file nearArtistSpanText = Spicetify.Player.data.track.metadata.album_title + } else if (Spicetify.Player.data.track.provider=="ad") { + // ad + nearArtistSpanText = "advertisement" + coverListenerInstalled = false + return } else { // When clicking a song from the homepage, songChange is fired with half empty metadata // todo: retry only once? @@ -385,6 +390,8 @@ async function songchange() { Spicetify.Player.addEventListener("songchange", songchange) function pickCoverColor(img) { + if (!img.currentSrc.startsWith('spotify:')) + return var swatches = new Vibrant(img, 5).swatches() lightCols = ["Vibrant", "DarkVibrant", "Muted", "LightVibrant"] darkCols = ["Vibrant", "LightVibrant", "Muted", "DarkVibrant"]