mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-05-24 12:35:05 +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") {
|
||||
// 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"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue