fix(SpotifyControls): Requests double-sending when using Spotify Connect (#2023)
This commit is contained in:
parent
fccdd3dc08
commit
3e7d946296
|
@ -55,13 +55,19 @@ export default definePlugin({
|
||||||
replace: "return [$self.renderPlayer(),$1]"
|
replace: "return [$self.renderPlayer(),$1]"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Adds POST and a Marker to the SpotifyAPI (so we can easily find it)
|
|
||||||
{
|
{
|
||||||
find: ".PLAYER_DEVICES",
|
find: ".PLAYER_DEVICES",
|
||||||
replacement: {
|
replacement: [{
|
||||||
|
// Adds POST and a Marker to the SpotifyAPI (so we can easily find it)
|
||||||
match: /get:(\i)\.bind\(null,(\i\.\i)\.get\)/,
|
match: /get:(\i)\.bind\(null,(\i\.\i)\.get\)/,
|
||||||
replace: "post:$1.bind(null,$2.post),$&"
|
replace: "post:$1.bind(null,$2.post),$&"
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
// Spotify Connect API returns status 202 instead of 204 when skipping tracks.
|
||||||
|
// Discord rejects 202 which causes the request to send twice. This patch prevents this.
|
||||||
|
match: /202===\i\.status/,
|
||||||
|
replace: "false",
|
||||||
|
}]
|
||||||
},
|
},
|
||||||
// Discord doesn't give you the repeat kind, only a boolean
|
// Discord doesn't give you the repeat kind, only a boolean
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue