magmastream 2.10.6-alpha.3 → 2.10.6-alpha.4

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.
@@ -1055,7 +1055,7 @@ class Node {
1055
1055
  }
1056
1056
  const requiredPlugins = ["lavalyrics-plugin"];
1057
1057
  for (const plugin of requiredPlugins) {
1058
- if (!this.info.plugins.some((p) => p.name === plugin)) {
1058
+ if (!(this.info?.plugins ?? []).some((p) => p.name === plugin)) {
1059
1059
  throw new MagmastreamError_1.MagmaStreamError({
1060
1060
  code: Enums_1.MagmaStreamErrorCode.NODE_PLUGIN_ERROR,
1061
1061
  message: `The plugin "${plugin}" must be present in the lavalink node.`,
@@ -1063,7 +1063,7 @@ class Node {
1063
1063
  });
1064
1064
  }
1065
1065
  }
1066
- if (!this.info.plugins.some((p) => p.name === "lavasrc-plugin" || p.name === "java-lyrics-plugin")) {
1066
+ if (!(this.info?.plugins ?? []).some((p) => p.name === "lavasrc-plugin" || p.name === "java-lyrics-plugin")) {
1067
1067
  throw new MagmastreamError_1.MagmaStreamError({
1068
1068
  code: Enums_1.MagmaStreamErrorCode.NODE_PLUGIN_ERROR,
1069
1069
  message: `One of the following plugins must also be present in the lavalink node: "lavasrc-plugin" or "java-lyrics-plugin".`,
@@ -1109,6 +1109,10 @@ class Node {
1109
1109
  catch (error) {
1110
1110
  lastError = error;
1111
1111
  this.manager.emit(Enums_1.ManagerEventTypes.Debug, `[NODE] Lyrics lookup on node ${this.options.identifier} failed (skipTrackSource=${skip}): ${error instanceof Error ? error.message : String(error)}`);
1112
+ // A missing plugin or a disconnected node fails the same way with skipTrackSource=true.
1113
+ if (error instanceof MagmastreamError_1.MagmaStreamError && (error.code === Enums_1.MagmaStreamErrorCode.NODE_PLUGIN_ERROR || error.code === Enums_1.MagmaStreamErrorCode.NODE_DISCONNECTED)) {
1114
+ break;
1115
+ }
1112
1116
  }
1113
1117
  }
1114
1118
  if (lrclibFallback) {
@@ -1180,7 +1184,7 @@ class Node {
1180
1184
  return await this.rest.post(`/v4/sessions/${this.sessionId}/players/${guildId}/lyrics/subscribe?skipTrackSource=${skipTrackSource}`, {});
1181
1185
  const requiredPlugins = ["lavalyrics-plugin"];
1182
1186
  for (const plugin of requiredPlugins) {
1183
- if (!this.info.plugins.some((p) => p.name === plugin)) {
1187
+ if (!(this.info?.plugins ?? []).some((p) => p.name === plugin)) {
1184
1188
  throw new MagmastreamError_1.MagmaStreamError({
1185
1189
  code: Enums_1.MagmaStreamErrorCode.NODE_PLUGIN_ERROR,
1186
1190
  message: `The plugin "${plugin}" must be present in the lavalink node.`,
@@ -1188,7 +1192,7 @@ class Node {
1188
1192
  });
1189
1193
  }
1190
1194
  }
1191
- if (!this.info.plugins.some((p) => p.name === "lavasrc-plugin" || p.name === "java-lyrics-plugin")) {
1195
+ if (!(this.info?.plugins ?? []).some((p) => p.name === "lavasrc-plugin" || p.name === "java-lyrics-plugin")) {
1192
1196
  throw new MagmastreamError_1.MagmaStreamError({
1193
1197
  code: Enums_1.MagmaStreamErrorCode.NODE_PLUGIN_ERROR,
1194
1198
  message: `One of the following plugins must also be present in the lavalink node: "lavasrc-plugin" or "java-lyrics-plugin".`,
@@ -1225,7 +1229,7 @@ class Node {
1225
1229
  }
1226
1230
  if (this.isNodeLink)
1227
1231
  return await this.rest.delete(`/v4/sessions/${this.sessionId}/players/${guildId}/lyrics/subscribe`);
1228
- if (!this.info.plugins.some((plugin) => plugin.name === "java-lyrics-plugin")) {
1232
+ if (!(this.info?.plugins ?? []).some((plugin) => plugin.name === "java-lyrics-plugin")) {
1229
1233
  throw new MagmastreamError_1.MagmaStreamError({
1230
1234
  code: Enums_1.MagmaStreamErrorCode.NODE_PLUGIN_ERROR,
1231
1235
  message: `The plugin "java-lyrics-plugin" must be present in the lavalink node to unsubscribe.`,
@@ -1387,7 +1391,7 @@ class Node {
1387
1391
  });
1388
1392
  }
1389
1393
  }
1390
- if (!this.info.plugins.some((plugin) => plugin.name === "sponsorblock-plugin")) {
1394
+ if (!(this.info?.plugins ?? []).some((plugin) => plugin.name === "sponsorblock-plugin")) {
1391
1395
  throw new MagmastreamError_1.MagmaStreamError({
1392
1396
  code: Enums_1.MagmaStreamErrorCode.NODE_PLUGIN_ERROR,
1393
1397
  message: `The plugin "sponsorblock-plugin" must be present in the lavalink node to fetch SponsorBlock data.`,
@@ -1617,7 +1621,7 @@ class Node {
1617
1621
  });
1618
1622
  }
1619
1623
  }
1620
- if (!this.info.plugins.some((plugin) => plugin.name === "sponsorblock-plugin")) {
1624
+ if (!(this.info?.plugins ?? []).some((plugin) => plugin.name === "sponsorblock-plugin")) {
1621
1625
  throw new MagmastreamError_1.MagmaStreamError({
1622
1626
  code: Enums_1.MagmaStreamErrorCode.NODE_PLUGIN_ERROR,
1623
1627
  message: `The plugin "sponsorblock-plugin" must be present in the lavalink node to set SponsorBlock segments.`,
@@ -1661,7 +1665,7 @@ class Node {
1661
1665
  });
1662
1666
  }
1663
1667
  }
1664
- if (!this.info.plugins.some((plugin) => plugin.name === "sponsorblock-plugin")) {
1668
+ if (!(this.info?.plugins ?? []).some((plugin) => plugin.name === "sponsorblock-plugin")) {
1665
1669
  throw new MagmastreamError_1.MagmaStreamError({
1666
1670
  code: Enums_1.MagmaStreamErrorCode.NODE_PLUGIN_ERROR,
1667
1671
  message: `The plugin "sponsorblock-plugin" must be present in the lavalink node to delete SponsorBlock segments.`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magmastream",
3
- "version": "2.10.6-alpha.3",
3
+ "version": "2.10.6-alpha.4",
4
4
  "description": "A user-friendly Lavalink client designed for NodeJS.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",