Skip to content

Commit

Permalink
[lastfm] fix asset fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
redstonekasi authored and yellowsink committed Apr 25, 2024
1 parent 64db941 commit 75f5407
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 2 additions & 5 deletions plugins/lastfm/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,12 @@ export async function getAsset(url: string) {

const res = await post({
url: `/applications/${DISCORD_APP_ID}/external-assets`,
body: JSON.stringify({ urls: [url] }),
body: { urls: [url] },
oldFormErrors: false,
headers: {
"Content-Type": "application/json",
},
});

if (res.ok) {
const path = JSON.parse(res.body)[0].external_asset_path;
const path = "mp:" + res.body[0].external_asset_path;
cache.set(url, path);
return path;
}
Expand Down
1 change: 0 additions & 1 deletion plugins/lastfm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { getAsset } from "./assets";
import { FluxStore } from "@uwu/shelter-defs";

const {
// @ts-expect-error
plugin: { store },
flux: { storesFlat, dispatcher },
} = shelter;
Expand Down

0 comments on commit 75f5407

Please sign in to comment.