mirror of
https://github.com/morpheusthewhite/spicetify-themes.git
synced 2024-11-23 03:12:53 +01:00
fix: Chart playlist icon
This commit is contained in:
parent
8d2a3629d4
commit
5fb3b142ed
@ -21,7 +21,7 @@ waitForElement([".LeftSidebar", ".LeftSidebar__section--rootlist .SidebarList__l
|
||||
if (!link || !link[0]) continue;
|
||||
link = link[0];
|
||||
|
||||
const href = link.href.replace("app:", "");
|
||||
let href = link.href.replace("app:", "");
|
||||
|
||||
if (href.indexOf("playlist-folder") != -1) {
|
||||
const button = item.getElementsByTagName("button")[0]
|
||||
@ -31,6 +31,10 @@ waitForElement([".LeftSidebar", ".LeftSidebar__section--rootlist .SidebarList__l
|
||||
continue;
|
||||
}
|
||||
|
||||
if (href.indexOf("chart") != -1) {
|
||||
href = href.replace("chart:", "user:spotifycharts:playlist:");
|
||||
}
|
||||
|
||||
Spicetify.CosmosAPI.resolver.get({
|
||||
url: `sp://core-playlist/v1/playlist/${href}/metadata`,
|
||||
body: { policy: { picture: true } },
|
||||
@ -48,7 +52,7 @@ waitForElement([".LeftSidebar", ".LeftSidebar__section--rootlist .SidebarList__l
|
||||
|
||||
new MutationObserver(loadPlaylistImage)
|
||||
.observe(queries[1], {childList: true});
|
||||
|
||||
|
||||
/** Replace Apps name with icons */
|
||||
|
||||
/** List of avaiable icons to use:
|
||||
@ -96,7 +100,7 @@ waitForElement([".LeftSidebar", ".LeftSidebar__section--rootlist .SidebarList__l
|
||||
case "playlist:local-files": return "localfile";
|
||||
case "stations": return "stations";
|
||||
}})(item.href.replace("spotify:app:", ""));
|
||||
|
||||
|
||||
replaceTextWithIcon(item.firstChild, icon);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user