Skip to content

Commit

Permalink
Fixed streamQualityEnable for nitro users
Browse files Browse the repository at this point in the history
  • Loading branch information
cafeed28 committed Mar 5, 2023
1 parent fad70d8 commit e477abd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ export async function start(): Promise<void> {
});

// 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 {
Expand Down

0 comments on commit e477abd

Please sign in to comment.