From e477abd42097a3c90462fe50ceb09d376b9c7581 Mon Sep 17 00:00:00 2001 From: cafeed28 Date: Sun, 5 Mar 2023 13:07:57 +0500 Subject: [PATCH] Fixed streamQualityEnable for nitro users --- src/index.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index b585924..6e43b3f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -58,9 +58,15 @@ export async function start(): Promise { }); // Stream quality - // FIXME: streamQualityEnable false will disable high quality for nitro users - injector.instead(premiumInfo, "canStreamHighQuality", () => config.get("streamQualityEnable")); - injector.instead(premiumInfo, "canStreamMidQuality", () => config.get("streamQualityEnable")); + injector.instead(premiumInfo, "canStreamHighQuality", (_, orig) => { + if (!config.get("streamQualityEnable")) return orig(_); + return true; + }); + + injector.instead(premiumInfo, "canStreamMidQuality", (_, orig) => { + if (!config.get("streamQualityEnable")) return orig(_); + return true; + }); } export function stop(): void {