mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-05-27 14:02:13 +00:00
WIP: #63 better handling of advertisements
This commit is contained in:
parent
4816bbb0b0
commit
4208a0001f
1 changed files with 7 additions and 0 deletions
|
|
@ -362,6 +362,11 @@ async function songchange() {
|
||||||
} else if (Spicetify.Player.data.track.metadata.is_local=="true") {
|
} else if (Spicetify.Player.data.track.metadata.is_local=="true") {
|
||||||
// local file
|
// local file
|
||||||
nearArtistSpanText = Spicetify.Player.data.track.metadata.album_title
|
nearArtistSpanText = Spicetify.Player.data.track.metadata.album_title
|
||||||
|
} else if (Spicetify.Player.data.track.provider=="ad") {
|
||||||
|
// ad
|
||||||
|
nearArtistSpanText = "advertisement"
|
||||||
|
coverListenerInstalled = false
|
||||||
|
return
|
||||||
} else {
|
} else {
|
||||||
// When clicking a song from the homepage, songChange is fired with half empty metadata
|
// When clicking a song from the homepage, songChange is fired with half empty metadata
|
||||||
// todo: retry only once?
|
// todo: retry only once?
|
||||||
|
|
@ -385,6 +390,8 @@ async function songchange() {
|
||||||
Spicetify.Player.addEventListener("songchange", songchange)
|
Spicetify.Player.addEventListener("songchange", songchange)
|
||||||
|
|
||||||
function pickCoverColor(img) {
|
function pickCoverColor(img) {
|
||||||
|
if (!img.currentSrc.startsWith('spotify:'))
|
||||||
|
return
|
||||||
var swatches = new Vibrant(img, 5).swatches()
|
var swatches = new Vibrant(img, 5).swatches()
|
||||||
lightCols = ["Vibrant", "DarkVibrant", "Muted", "LightVibrant"]
|
lightCols = ["Vibrant", "DarkVibrant", "Muted", "LightVibrant"]
|
||||||
darkCols = ["Vibrant", "LightVibrant", "Muted", "DarkVibrant"]
|
darkCols = ["Vibrant", "LightVibrant", "Muted", "DarkVibrant"]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue