10 changes: 4 additions & 6 deletions .github/workflows/prettier.yml
Expand Up @@ -10,12 +10,10 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0
persist-credentials: false

- name: Prettify code
- name: Test formatting
uses: creyD/prettier_action@v4.3
with:
prettier_options: --write .
commit_message: "style: prettify code"
github_token: ${{ secrets.SPICETIFY_GITHUB_TOKEN }}
prettier_options: --check .
only_changed: true
dry: true
5 changes: 4 additions & 1 deletion .gitignore
@@ -1,5 +1,5 @@
# Executables
bin/
bin
spicetify-cli
spicetify
*.exe
Expand All @@ -14,3 +14,6 @@ package.json

# Logs
install.log

# VSCode
.vscode
2 changes: 1 addition & 1 deletion CustomApps/lyrics-plus/TabBar.js
Expand Up @@ -193,7 +193,7 @@ const TabBar = react.memo(({ links, activeLink, lockLink, switchCallback, lockCa
items: droplistItem.map(i => options[i]).filter(i => i),
switchTo: switchCallback,
lockIn: lockCallback
})
})
: null
)
);
Expand Down
30 changes: 27 additions & 3 deletions CustomApps/new-releases/Card.js
Expand Up @@ -4,7 +4,7 @@ function DraggableComponent({ uri, title, children }) {
? react.cloneElement(children, {
onDragStart: dragHandler,
draggable: "true"
})
})
: children;
}

Expand All @@ -31,7 +31,31 @@ class Card extends react.Component {

closeButtonClicked(event) {
removeCards(this.props.uri);
Spicetify.showNotification(`Dismissed <b>${this.title}</b> from <b>${this.artist.name}</b>`);

Spicetify.Snackbar.enqueueCustomSnackbar
? Spicetify.Snackbar.enqueueCustomSnackbar("dismissed-release", {
keyPrefix: "dismissed-release",
children: Spicetify.ReactComponent.Snackbar.wrapper({
children: Spicetify.ReactComponent.Snackbar.simpleLayout({
leading: Spicetify.ReactComponent.Snackbar.styledImage({
src: this.props.imageURL,
imageHeight: "24px",
imageWidth: "24px"
}),
center: Spicetify.React.createElement("div", {
dangerouslySetInnerHTML: {
__html: `Dismissed <b>${this.title}</b>.`
}
}),
trailing: Spicetify.ReactComponent.Snackbar.ctaText({
ctaText: "Undo",
onCtaClick: () => removeCards(this.props.uri, "undo")
})
})
})
})
: Spicetify.showNotification(`Dismissed <b>${this.title}</b> from <br>${this.artist.name}</b>`);

event.stopPropagation();
}

Expand Down Expand Up @@ -145,7 +169,7 @@ class Card extends react.Component {
className: "main-card-closeButton-svg"
},
react.createElement("path", {
d: "M1.47 1.47a.75.75 0 0 1 1.06 0L8 6.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L9.06 8l5.47 5.47a.75.75 0 1 1-1.06 1.06L8 9.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L6.94 8 1.47 2.53a.75.75 0 0 1 0-1.06z",
d: "M2.47 2.47a.75.75 0 0 1 1.06 0L8 6.94l4.47-4.47a.75.75 0 1 1 1.06 1.06L9.06 8l4.47 4.47a.75.75 0 1 1-1.06 1.06L8 9.06l-4.47 4.47a.75.75 0 0 1-1.06-1.06L6.94 8 2.47 3.53a.75.75 0 0 1 0-1.06Z",
fill: "var(--spice-text)",
fillRule: "evenodd"
})
Expand Down
18 changes: 8 additions & 10 deletions CustomApps/new-releases/index.js
Expand Up @@ -120,8 +120,8 @@ class Grid extends react.Component {
break;
case "undo":
if (!dismissed[0]) Spicetify.showNotification("Nothing to undo", true);
else Spicetify.showNotification("Undone last dismiss");
dismissed.pop();
else Spicetify.showNotification("Undone dismissal");
dismissed = id ? dismissed.filter(item => item !== id) : dismissed.slice(0, -1);
break;
default:
dismissed.push(id);
Expand Down Expand Up @@ -269,17 +269,16 @@ class Grid extends react.Component {
}

async function getArtistList() {
const body = await CosmosAsync.get("sp://core-collection/unstable/@/list/artists/all?responseFormat=protobufJson", {
policy: { list: { link: true, name: true } }
});
const base = await Spicetify.Platform.LibraryAPI.getArtists();
const artists = await Spicetify.Platform.LibraryAPI.getArtists({ limit: base.totalLength });
count(true);
return body.item ?? [];
return artists.items ?? [];
}

async function getArtistEverything(artist) {
const { queryArtistDiscographyAll } = Spicetify.GraphQL.Definitions;
const { data, errors } = await Spicetify.GraphQL.Request(queryArtistDiscographyAll, {
uri: artist.link,
uri: artist.uri,
offset: 0,
// Limit 100 since GraphQL has resource limit
limit: 100
Expand Down Expand Up @@ -332,7 +331,7 @@ function metaFromTrack(artist, track) {
title: track.name,
artist: {
name: artist.name,
uri: artist.link
uri: artist.uri
},
imageURL: track.coverArt.sources.reduce((prev, curr) => (prev.width > curr.width ? prev : curr)).url,
time,
Expand All @@ -354,8 +353,7 @@ async function fetchTracks() {
Spicetify.showNotification(`Fetching releases from ${artistList.length} artists`);

const requests = artistList.map(async obj => {
const artist = obj.artistMetadata;
return await getArtistEverything(artist).catch(err => {
return await getArtistEverything(obj).catch(err => {
console.debug("Could not fetch all releases", err);
console.debug(`Missing releases from ${count()} artists`);
});
Expand Down
2 changes: 1 addition & 1 deletion CustomApps/reddit/TabBar.js
Expand Up @@ -166,7 +166,7 @@ const TabBar = react.memo(({ links, activeLink, switchCallback, windowSize = Inf
? react.createElement(TabBarMore, {
items: droplistItem.map(i => options[i]).filter(i => i),
switchTo: switchCallback
})
})
: null
)
);
Expand Down
2 changes: 1 addition & 1 deletion Extensions/shuffle+.js
Expand Up @@ -574,7 +574,7 @@
}

context = rawUri;
if (type === "folder" || type === "collection") {
if (type === "folder" || type === "collection" || type === "local") {
context = null;
}
}
Expand Down
22 changes: 21 additions & 1 deletion css-map.json
Expand Up @@ -2012,6 +2012,7 @@
"CCi1L2OQvgdZvxkRHeKE": "search-searchBrowse-SearchBrowse",
"rvvoAdb7aaUPYRasW7sK": "search-searchBrowse-browseAllContainer",
"UdXTcsz1eiiInKThkfYp": "search-searchBrowse-browseAllWrapper",
"M7LKuAFiIKaigK0fVguF": "search-searchBrowse-browseAllWrapper",
"khkfPsJuVBQyL_5cLT7y": "search-recentSearches-searchPageGrid",
"fVB_YDdnaDlztX7CcWTA": "search-searchCategory-SearchCategory",
"e179_Eg8r7Ub6yjjxctr": "search-searchCategory-container",
Expand Down Expand Up @@ -2554,5 +2555,24 @@
"bQthUEx0_U98DJkT1saO": "x-categoryCard-title",
"eEZSnYlv7__34b2yulfm": "volume-bar",
"FZhaXNtbN3Crwrgd0TA7": "volume-bar__icon-button",
"x1jWng8HDweDS840aiIA": "volume-bar__slider-container"
"x1jWng8HDweDS840aiIA": "volume-bar__slider-container",
"NH6UaoYYe47eIHA2Rmal": "main-card-imageContainerOld",
"AYwATC_zEPwCkmO1yc8R": "main-card-imageContainerSkeleton",
"coBkWVskipFo8KxLKief": "main-topBar-withBackgroundBlur",
"ep0_ry7CLwf91E1rN6Cv": "main-yourLibraryX-pulse",
"RmWKJG2G0fTrx11zKv_j": "main-entityHeader-theyFollowUs",
"kzlksKUC9aLBM62Bckxo": "main-whatsNewFeed-actions",
"bcU463yG4LHEtlBCOa8Q": "main-whatsNewFeed-buttonAlwaysVisible",
"n5y3jDsz8siC0JsxtS83": "main-whatsNewFeed-buttonVisibleOnHover",
"CONFZNJkrMwpneVuYWXC": "main-whatsNewFeed-description",
"Z1qkHjt67N3DaWqnEM0w": "main-whatsNewFeed-imageContainer",
"nzZgeVfx1Y6nZe7Z9DsA": "main-whatsNewFeed-showImage",
"j45TgktnaHqgEqeO3eXI": "main-whatsNewFeed-largeImage",
"lgo_zhUnwxG2Qan4WLBY": "main-whatsNewFeed-dateAndTime",
"uuqowKOQLu0zbk4zguPM": "main-whatsNewFeed-medium",
"uSj66OUSURBfFwFhD7Ed": "main-whatsNewFeed-separator",
"sQnWbTOGnPZBNn3lZTtI": "main-whatsNewFeed-separatorAlbum",
"eyWbmr17oov600GluVsy": "main-whatsNewFeed-divider",
"_MBf1tVqzfo2AefcuHwv": "main-whatsNewFeed-listRow",
"Z3LszrbA1M2fpLsEhlQT": "main-whatsNewFeed-progressBar"
}