@uimaxbai/am-lyrics 1.2.1 → 1.2.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/src/react.js CHANGED
@@ -322,7 +322,7 @@ class GoogleService {
322
322
  }
323
323
  }
324
324
 
325
- const VERSION = '1.2.1';
325
+ const VERSION = '1.2.3';
326
326
  const INSTRUMENTAL_THRESHOLD_MS = 7000; // Show dots for gaps >= 7s
327
327
  const FETCH_TIMEOUT_MS = 8000; // Timeout for all lyrics fetch requests
328
328
  const SEEK_THRESHOLD_MS = 500;
@@ -540,7 +540,8 @@ let AmLyrics$1 = class AmLyrics extends i {
540
540
  const isMusicIdOnlyRequest = Boolean(this.musicId) &&
541
541
  !this.songTitle &&
542
542
  !this.songArtist &&
543
- !this.query;
543
+ !this.query &&
544
+ !this.isrc;
544
545
  const collectedSources = [];
545
546
  if (resolvedMetadata?.metadata && !isMusicIdOnlyRequest) {
546
547
  const title = resolvedMetadata.metadata.title?.trim() || '';
@@ -757,7 +758,7 @@ let AmLyrics$1 = class AmLyrics extends i {
757
758
  }
758
759
  const appleSong = null;
759
760
  let appleId = this.musicId;
760
- let catalogIsrc;
761
+ let catalogIsrc = this.isrc;
761
762
  if (this.query &&
762
763
  (!metadata.title || !metadata.artist || !metadata.album)) {
763
764
  const parsed = AmLyrics.parseQueryMetadata(this.query);
@@ -884,9 +885,15 @@ let AmLyrics$1 = class AmLyrics extends i {
884
885
  return null;
885
886
  }
886
887
  static async fetchLyricsFromYouLyPlus(title, artist, isrc, metadata = {}) {
887
- if (!title || !artist)
888
+ if ((!title || !artist) && !isrc)
888
889
  return [];
889
- const params = new URLSearchParams({ title, artist });
890
+ const params = new URLSearchParams();
891
+ if (title)
892
+ params.append('title', title);
893
+ if (artist)
894
+ params.append('artist', artist);
895
+ if (isrc)
896
+ params.append('isrc', isrc);
890
897
  if (metadata.album) {
891
898
  params.append('album', metadata.album);
892
899
  }
@@ -947,7 +954,7 @@ let AmLyrics$1 = class AmLyrics extends i {
947
954
  }
948
955
  }
949
956
  // Second attempt: Fallback to title and artist search if ISRC search failed or was not available
950
- if (!cacheData) {
957
+ if (!cacheData && title && artist) {
951
958
  const cacheParams = new URLSearchParams({
952
959
  track: title,
953
960
  artist,
@@ -3317,7 +3324,7 @@ let AmLyrics$1 = class AmLyrics extends i {
3317
3324
  }
3318
3325
  else {
3319
3326
  isGrowableVW =
3320
- combinedDuration >= 800 && combinedDuration >= wordLen * 180;
3327
+ combinedDuration >= 900 && combinedDuration >= wordLen * 300;
3321
3328
  }
3322
3329
  }
3323
3330
  // Glow requirement (more strict)