فهرست منبع

fix: utm param for dev mode

Sv443 1 سال پیش
والد
کامیت
0e2b90f6f3
2فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 3 3
      dist/BetterYTM.user.js
  2. 3 3
      src/features/lyrics.ts

+ 3 - 3
dist/BetterYTM.user.js

@@ -256,7 +256,7 @@ const scriptInfo = {
     name: GM.info.script.name,
     version: GM.info.script.version,
     namespace: GM.info.script.namespace,
-    buildNumber: "bccce1c", // asserted as generic string instead of literal
+    buildNumber: "84f187b", // asserted as generic string instead of literal
 };/** Options that are applied to every SelectorObserver instance */
 const defaultObserverOptions = {
     defaultDebounce: 100,
@@ -3136,8 +3136,8 @@ function fetchLyricsUrls(artist, song) {
             const startTs = Date.now();
             const fetchUrl = constructUrlString(geniURLSearchUrl, {
                 disableFuzzy: null,
-                utm_source: "BetterYTM",
-                utm_content: `v${scriptInfo.version}`,
+                utm_source: scriptInfo.name,
+                utm_content: mode === "development" ? "dev" : `v${scriptInfo.version}`,
                 artist,
                 song,
             });

+ 3 - 3
src/features/lyrics.ts

@@ -2,7 +2,7 @@ import { ConfigManager, autoPlural, clamp, compress, decompress, fetchAdvanced,
 import Fuse from "fuse.js";
 import { constructUrlString, error, getResourceUrl, info, log, onSelectorOld, warn, t, tp, compressionSupported } from "../utils";
 import { emitInterface } from "../interface";
-import { compressionFormat, scriptInfo } from "../constants";
+import { compressionFormat, mode, scriptInfo } from "../constants";
 import type { LyricsCacheEntry } from "../types";
 
 /** Base URL of geniURL */
@@ -328,8 +328,8 @@ export async function fetchLyricsUrls(artist: string, song: string): Promise<Omi
     const startTs = Date.now();
     const fetchUrl = constructUrlString(geniURLSearchUrl, {
       disableFuzzy: null,
-      utm_source: "BetterYTM",
-      utm_content: `v${scriptInfo.version}`,
+      utm_source: scriptInfo.name,
+      utm_content: mode === "development" ? "dev" : `v${scriptInfo.version}`,
       artist,
       song,
     });