Skip to content

Commit

Permalink
Minor spreading adjustments, PR merge - releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomato6966 committed Dec 10, 2024
1 parent 1c36340 commit 2bb313c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lavalink-client",
"version": "2.4.1",
"version": "2.4.2",
"description": "Easy, flexible and feature-rich lavalink@v4 Client. Both for Beginners and Proficients.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/structures/Filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class FilterManager {
sendData.equalizer = [...this.equalizerBands];
if (sendData.equalizer.length === 0) delete sendData.equalizer;

for (const key of [...Object.keys(sendData)]) {
for (const key of Object.keys(sendData)) {
// delete disabled filters
if (key === "pluginFilters") {
// for(const key of [...Object.keys(sendData.pluginFilters)]) {
Expand Down Expand Up @@ -177,7 +177,7 @@ export class FilterManager {
this.filters.vibrato = this.data.vibrato.frequency !== 0 || this.data.vibrato.depth !== 0;
this.filters.tremolo = this.data.tremolo.frequency !== 0 || this.data.tremolo.depth !== 0;

const lavalinkFilterData = (this.data.pluginFilters?.["lavalink-filter-plugin"] || { echo: { decay: this.data.pluginFilters?.echo?.decay && !this.data.pluginFilters?.echo?.echoLength ? this.data.pluginFilters.echo.decay : 0, delay: (this.data.pluginFilters?.echo as { decay: number, delay: number })?.delay || 0 }, reverb: { gains: [], delays: [], ...(((this.data.pluginFilters as { reverb: { gains: number[], delays: number[] } }).reverb) || {}) } });
const lavalinkFilterData = (this.data.pluginFilters?.["lavalink-filter-plugin"] || { echo: { decay: this.data.pluginFilters?.echo?.decay && !this.data.pluginFilters?.echo?.echoLength ? this.data.pluginFilters.echo.decay : 0, delay: (this.data.pluginFilters?.echo as { decay: number, delay: number })?.delay || 0 }, reverb: { gains: [], delays: [], ...((this.data.pluginFilters as { reverb: { gains: number[], delays: number[] } }).reverb) } });
this.filters.lavalinkFilterPlugin.echo = lavalinkFilterData.echo.decay !== 0 || lavalinkFilterData.echo.delay !== 0;
this.filters.lavalinkFilterPlugin.reverb = lavalinkFilterData.reverb?.delays?.length !== 0 || lavalinkFilterData.reverb?.gains?.length !== 0;
this.filters.lavalinkLavaDspxPlugin.highPass = Object.values(this.data.pluginFilters["high-pass"] || {}).length > 0;
Expand Down
2 changes: 1 addition & 1 deletion src/structures/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ export class LavalinkNode {
}

if (typeof data.playerOptions.filters !== "undefined") {
const oldFilterTimescale = { ...(player.filterManager.data.timescale || {}) };
const oldFilterTimescale = { ...player.filterManager.data.timescale };
Object.freeze(oldFilterTimescale);
if (data.playerOptions.filters.timescale) player.filterManager.data.timescale = data.playerOptions.filters.timescale;
if (data.playerOptions.filters.distortion) player.filterManager.data.distortion = data.playerOptions.filters.distortion;
Expand Down
6 changes: 3 additions & 3 deletions src/structures/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class ManagerUtils {
buildPluginInfo(data: any, clientData: any = {}) {
return {
clientData: clientData,
...(data.pluginInfo || (data as any).plugin || {})
...(data.pluginInfo || (data as any).plugin),
}
}

Expand Down Expand Up @@ -82,7 +82,7 @@ export class ManagerUtils {
isrc: data.info.isrc,
},
userData: {
...(data.userData || {}),
...data.userData,
requester: transformedRequester
},
pluginInfo: this.buildPluginInfo(data, "clientData" in data ? data.clientData : {}),
Expand Down Expand Up @@ -462,7 +462,7 @@ export class MiniMap<K, V> extends Map<K, V> {
const iter = this.entries();
return Array.from({ length: this.size }, (): T => {
const [key, value] = iter.next().value;

return fn(value, key, this);
});
}
Expand Down

0 comments on commit 2bb313c

Please sign in to comment.