Browse Source

feat: temp. disable geniURL fuzzy filtering

Sv443 1 year ago
parent
commit
3562f14ef4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/features/lyrics.ts

+ 2 - 2
src/features/lyrics.ts

@@ -15,6 +15,7 @@ const threshold = 0.55;
 const geniUrlRatelimitTimeframe = 30;
 
 const thresholdParam = threshold ? `&threshold=${clamp(threshold, 0, 1)}` : "";
+void thresholdParam; // TODO: remove once geniURL 1.4 is released
 
 //#MARKER cache
 
@@ -48,7 +49,6 @@ export function addMediaCtrlLyricsBtn(): void {
   onSelector(".middle-controls-buttons ytmusic-like-button-renderer#like-button-renderer", { listener: addActualMediaCtrlLyricsBtn });
 }
 
-// TODO: add error.svg if the request fails
 /** Actually adds the lyrics button after the like button renderer has been verified to exist */
 async function addActualMediaCtrlLyricsBtn(likeContainer: HTMLElement) {
   const songTitleElem = document.querySelector<HTMLDivElement>(".content-info-wrapper > yt-formatted-string");
@@ -210,7 +210,7 @@ export async function getGeniusUrl(artist: string, song: string): Promise<string
     }
 
     const startTs = Date.now();
-    const fetchUrl = `${geniURLSearchTopUrl}?artist=${encodeURIComponent(artist)}&song=${encodeURIComponent(song)}${thresholdParam}`;
+    const fetchUrl = `${geniURLSearchTopUrl}?disableFuzzy&artist=${encodeURIComponent(artist)}&song=${encodeURIComponent(song)}`;
 
     log(`Requesting URL from geniURL at '${fetchUrl}'`);