api/service-config: replace static arrays with sets

This commit is contained in:
wukko
2025-06-25 19:33:16 +06:00
parent fcdf5da73e
commit 52695cbd0f
3 changed files with 4 additions and 4 deletions

View File

@@ -194,7 +194,7 @@ export default function({
break;
case "audio":
if (audioIgnore.includes(host) || (host === "reddit" && r.typeId === "redirect")) {
if (audioIgnore.has(host) || (host === "reddit" && r.typeId === "redirect")) {
return createResponse("error", {
code: "error.api.service.audio_not_supported"
})

View File

@@ -1,7 +1,7 @@
import UrlPattern from "url-pattern";
export const audioIgnore = ["vk", "ok", "loom"];
export const hlsExceptions = ["dailymotion", "vimeo", "rutube", "bsky", "youtube"];
export const audioIgnore = new Set(["vk", "ok", "loom"]);
export const hlsExceptions = new Set(["dailymotion", "vimeo", "rutube", "bsky", "youtube"]);
export const services = {
bilibili: {