lavalink-client 2.7.2 → 2.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -41,7 +41,8 @@ declare class FilterManager {
41
41
  * ```
42
42
  */
43
43
  applyPlayerFilters(): Promise<void>;
44
- privateNot0(value: number | undefined): boolean;
44
+ private privateNot0;
45
+ private getLavalinkFilterData;
45
46
  /**
46
47
  * Checks if the filters are correctly stated (active / not-active) - mostly used internally.
47
48
  * @param oldFilterTimescale
package/dist/index.d.ts CHANGED
@@ -41,7 +41,8 @@ declare class FilterManager {
41
41
  * ```
42
42
  */
43
43
  applyPlayerFilters(): Promise<void>;
44
- privateNot0(value: number | undefined): boolean;
44
+ private privateNot0;
45
+ private getLavalinkFilterData;
45
46
  /**
46
47
  * Checks if the filters are correctly stated (active / not-active) - mostly used internally.
47
48
  * @param oldFilterTimescale
package/dist/index.js CHANGED
@@ -2961,6 +2961,19 @@ var FilterManager = class {
2961
2961
  privateNot0(value) {
2962
2962
  return typeof value === "number" && value !== 0;
2963
2963
  }
2964
+ getLavalinkFilterData() {
2965
+ return this.data.pluginFilters?.["lavalink-filter-plugin"] || {
2966
+ echo: {
2967
+ decay: this.data.pluginFilters?.echo?.decay && !this.data.pluginFilters?.echo?.echoLength ? this.data.pluginFilters?.echo?.decay : 0,
2968
+ delay: this.data.pluginFilters?.echo?.delay || 0
2969
+ },
2970
+ reverb: {
2971
+ gains: [],
2972
+ delays: [],
2973
+ ...this.data.pluginFilters?.reverb
2974
+ }
2975
+ };
2976
+ }
2964
2977
  /**
2965
2978
  * Checks if the filters are correctly stated (active / not-active) - mostly used internally.
2966
2979
  * @param oldFilterTimescale
@@ -2979,13 +2992,17 @@ var FilterManager = class {
2979
2992
  this.filters.rotation = this.privateNot0(this.data.rotation?.rotationHz);
2980
2993
  this.filters.vibrato = this.privateNot0(this.data.vibrato?.frequency) || this.privateNot0(this.data.vibrato?.depth);
2981
2994
  this.filters.tremolo = this.privateNot0(this.data.tremolo?.frequency) || this.privateNot0(this.data.tremolo?.depth);
2982
- 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?.delay || 0 }, reverb: { gains: [], delays: [], ...this.data.pluginFilters.reverb } };
2983
- this.filters.lavalinkFilterPlugin.echo = lavalinkFilterData.echo.decay !== 0 || lavalinkFilterData.echo.delay !== 0;
2984
- this.filters.lavalinkFilterPlugin.reverb = lavalinkFilterData.reverb?.delays?.length !== 0 || lavalinkFilterData.reverb?.gains?.length !== 0;
2985
- this.filters.lavalinkLavaDspxPlugin.highPass = Object.values(this.data.pluginFilters?.["high-pass"] || {}).length > 0;
2986
- this.filters.lavalinkLavaDspxPlugin.lowPass = Object.values(this.data.pluginFilters?.["low-pass"] || {}).length > 0;
2987
- this.filters.lavalinkLavaDspxPlugin.normalization = Object.values(this.data.pluginFilters?.normalization || {}).length > 0;
2988
- this.filters.lavalinkLavaDspxPlugin.echo = Object.values(this.data.pluginFilters?.echo || {}).length > 0 && typeof this.data.pluginFilters?.echo?.delay === "undefined";
2995
+ const lavalinkFilterData = this.getLavalinkFilterData();
2996
+ this.filters.lavalinkFilterPlugin = {
2997
+ echo: this.privateNot0(lavalinkFilterData?.echo?.decay) || this.privateNot0(lavalinkFilterData?.echo?.delay),
2998
+ reverb: this.privateNot0(lavalinkFilterData?.reverb?.delays?.length) || this.privateNot0(lavalinkFilterData?.reverb?.gains?.length)
2999
+ };
3000
+ this.filters.lavalinkLavaDspxPlugin = {
3001
+ lowPass: Object.values(this.data.pluginFilters?.["low-pass"] || {})?.length > 0,
3002
+ highPass: Object.values(this.data.pluginFilters?.["high-pass"] || {})?.length > 0,
3003
+ normalization: Object.values(this.data.pluginFilters?.normalization || {})?.length > 0,
3004
+ echo: Object.values(this.data.pluginFilters?.echo || {})?.length > 0 && typeof this.data.pluginFilters?.echo?.delay === "undefined"
3005
+ };
2989
3006
  this.filters.lowPass = this.privateNot0(this.data.lowPass?.smoothing);
2990
3007
  this.filters.karaoke = Object.values(this.data.karaoke ?? {}).some((v) => v !== 0);
2991
3008
  if ((this.filters.nightcore || this.filters.vaporwave) && oldFilterTimescale) {
package/dist/index.mjs CHANGED
@@ -2900,6 +2900,19 @@ var FilterManager = class {
2900
2900
  privateNot0(value) {
2901
2901
  return typeof value === "number" && value !== 0;
2902
2902
  }
2903
+ getLavalinkFilterData() {
2904
+ return this.data.pluginFilters?.["lavalink-filter-plugin"] || {
2905
+ echo: {
2906
+ decay: this.data.pluginFilters?.echo?.decay && !this.data.pluginFilters?.echo?.echoLength ? this.data.pluginFilters?.echo?.decay : 0,
2907
+ delay: this.data.pluginFilters?.echo?.delay || 0
2908
+ },
2909
+ reverb: {
2910
+ gains: [],
2911
+ delays: [],
2912
+ ...this.data.pluginFilters?.reverb
2913
+ }
2914
+ };
2915
+ }
2903
2916
  /**
2904
2917
  * Checks if the filters are correctly stated (active / not-active) - mostly used internally.
2905
2918
  * @param oldFilterTimescale
@@ -2918,13 +2931,17 @@ var FilterManager = class {
2918
2931
  this.filters.rotation = this.privateNot0(this.data.rotation?.rotationHz);
2919
2932
  this.filters.vibrato = this.privateNot0(this.data.vibrato?.frequency) || this.privateNot0(this.data.vibrato?.depth);
2920
2933
  this.filters.tremolo = this.privateNot0(this.data.tremolo?.frequency) || this.privateNot0(this.data.tremolo?.depth);
2921
- 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?.delay || 0 }, reverb: { gains: [], delays: [], ...this.data.pluginFilters.reverb } };
2922
- this.filters.lavalinkFilterPlugin.echo = lavalinkFilterData.echo.decay !== 0 || lavalinkFilterData.echo.delay !== 0;
2923
- this.filters.lavalinkFilterPlugin.reverb = lavalinkFilterData.reverb?.delays?.length !== 0 || lavalinkFilterData.reverb?.gains?.length !== 0;
2924
- this.filters.lavalinkLavaDspxPlugin.highPass = Object.values(this.data.pluginFilters?.["high-pass"] || {}).length > 0;
2925
- this.filters.lavalinkLavaDspxPlugin.lowPass = Object.values(this.data.pluginFilters?.["low-pass"] || {}).length > 0;
2926
- this.filters.lavalinkLavaDspxPlugin.normalization = Object.values(this.data.pluginFilters?.normalization || {}).length > 0;
2927
- this.filters.lavalinkLavaDspxPlugin.echo = Object.values(this.data.pluginFilters?.echo || {}).length > 0 && typeof this.data.pluginFilters?.echo?.delay === "undefined";
2934
+ const lavalinkFilterData = this.getLavalinkFilterData();
2935
+ this.filters.lavalinkFilterPlugin = {
2936
+ echo: this.privateNot0(lavalinkFilterData?.echo?.decay) || this.privateNot0(lavalinkFilterData?.echo?.delay),
2937
+ reverb: this.privateNot0(lavalinkFilterData?.reverb?.delays?.length) || this.privateNot0(lavalinkFilterData?.reverb?.gains?.length)
2938
+ };
2939
+ this.filters.lavalinkLavaDspxPlugin = {
2940
+ lowPass: Object.values(this.data.pluginFilters?.["low-pass"] || {})?.length > 0,
2941
+ highPass: Object.values(this.data.pluginFilters?.["high-pass"] || {})?.length > 0,
2942
+ normalization: Object.values(this.data.pluginFilters?.normalization || {})?.length > 0,
2943
+ echo: Object.values(this.data.pluginFilters?.echo || {})?.length > 0 && typeof this.data.pluginFilters?.echo?.delay === "undefined"
2944
+ };
2928
2945
  this.filters.lowPass = this.privateNot0(this.data.lowPass?.smoothing);
2929
2946
  this.filters.karaoke = Object.values(this.data.karaoke ?? {}).some((v) => v !== 0);
2930
2947
  if ((this.filters.nightcore || this.filters.vaporwave) && oldFilterTimescale) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lavalink-client",
3
- "version": "2.7.2",
3
+ "version": "2.7.3",
4
4
  "description": "Easy, flexible and feature-rich lavalink@v4 Client. Both for Beginners and Proficients.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",