Update dribbblish-dynamic.js

removed track popularity percentage
This commit is contained in:
Julien 2020-11-26 20:56:46 +01:00 committed by GitHub
parent 3bc4d1f700
commit 8a8516dd6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,19 +170,12 @@ function LightenDarkenColor(hex, amt) {
return '#'+newColor.toString(16);
}
var nearTrackSpan = null
var nearArtistSpan = null
var mainColor = getComputedStyle(document.documentElement).getPropertyValue('--modspotify_main_fg')
var mainColor2 = getComputedStyle(document.documentElement).getPropertyValue('--modspotify_main_bg')
var isLightBg = isLight(mainColor2)
var lastDoc = null
waitForElement([".track"], (queries) => {
nearTrackSpan = document.createElement("span");
nearTrackSpan.id = "dribbblish-track-info";
queries[0].append(nearTrackSpan);
});
waitForElement([".artist"], (queries) => {
nearArtistSpan = document.createElement("span");
nearArtistSpan.id = "dribbblish-album-info";
@ -267,7 +260,6 @@ async function songchange() {
album_date = album_date.toLocaleString('default', album_date>recent_date ? { year: 'numeric', month: 'short' } : { year: 'numeric' })
album_link = "<a title=\""+Spicetify.Player.data.track.metadata.album_title+"\" href=\""+album_uri+"\" data-uri=\""+album_uri+"\" data-interaction-target=\"album-name\" class=\"tl-cell__content\">"+Spicetify.Player.data.track.metadata.album_title+"</a>"
if (nearTrackSpan!==null) nearTrackSpan.innerText = " • " + Spicetify.Player.data.track.metadata.popularity + "%"
if (nearArtistSpan!==null) nearArtistSpan.innerHTML = " — " + album_link + " • " + album_date
//waitForElement([".album-art__artist-name"], (queries) => {
@ -275,11 +267,9 @@ async function songchange() {
//}, 1000)
} else if (Spicetify.Player.data.track.metadata.album_track_number==0) {
// podcast?
nearTrackSpan.innerText = ""
nearArtistSpan.innerText = Spicetify.Player.data.track.metadata.album_title
} else if (Spicetify.Player.data.track.metadata.is_local=="true") {
// local?
nearTrackSpan.innerText = ""
nearArtistSpan.innerText = Spicetify.Player.data.track.metadata.album_title
} else {
// When clicking a song from the homepage, songChange is fired with half empty metadata
@ -312,4 +302,4 @@ Spicetify.Player.addEventListener("appchange", ({"data": data}) => {
//lastDoc = data.container.contentDocument.documentElement || data.container
setTimeout(updateColorsAllIframes, 200)
//updateColorsAllIframes()
})
})