Fix SpotifyControls

This commit is contained in:
Vendicated 2023-10-25 19:28:07 +02:00
parent 685f44d40f
commit c3ccbbfa99
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
2 changed files with 4 additions and 4 deletions

View file

@ -71,7 +71,7 @@ export const SpotifyStore = proxyLazy(() => {
const { Store } = Flux;
const SpotifySocket = findByPropsLazy("getActiveSocketAndDevice");
const SpotifyAPI = findByPropsLazy("SpotifyAPIMarker");
const SpotifyUtils = findByPropsLazy("SpotifyAPI");
const API_BASE = "https://api.spotify.com/v1/me/player";
@ -169,7 +169,7 @@ export const SpotifyStore = proxyLazy(() => {
(data.query ??= {}).device_id = this.device.id;
const { socket } = SpotifySocket.getActiveSocketAndDevice();
return SpotifyAPI[method](socket.accountId, socket.accessToken, {
return SpotifyUtils.SpotifyAPI[method](socket.accountId, socket.accessToken, {
url: API_BASE + route,
...data
});

View file

@ -59,8 +59,8 @@ export default definePlugin({
{
find: ".PLAYER_DEVICES",
replacement: {
match: /get:(.{1,3})\.bind\(null,(.{1,6})\.get\)/,
replace: "SpotifyAPIMarker:1,post:$1.bind(null,$2.post),$&"
match: /get:(\i)\.bind\(null,(\i\.\i)\.get\)/,
replace: "post:$1.bind(null,$2.post),$&"
}
},
// Discord doesn't give you the repeat kind, only a boolean