diff --git a/.env b/.env index 7905676c..7669f5d7 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -RV_API_URL="https://releases.revanced.app" +RV_API_URL="https://api.revanced.app" diff --git a/src/data/api/index.ts b/src/data/api/index.ts index 5614536c..e2db88b8 100644 --- a/src/data/api/index.ts +++ b/src/data/api/index.ts @@ -19,7 +19,7 @@ async function repositories(): Promise { async function tools(): Promise { const json = await get_json('tools'); // Make the data easier to work with. - let map: Map = new Map(); + const map: Map = new Map(); for (const tool of json['tools']) { const repo: string = tool.repository; @@ -33,7 +33,7 @@ async function tools(): Promise { }); } - let value = map.get(repo)!!; + const value = map.get(repo)!!; value.assets.push({ name: tool.name, size: tool.size, @@ -52,12 +52,12 @@ async function manager(): Promise { } async function patches(): Promise { - const json = await get_json('patches'); + const json = await get_json('v2/patches/latest'); const packagesWithCount: { [key: string]: number } = {}; // gets packages and patch count - for (let i = 0; i < json.length; i++) { - json[i].compatiblePackages.forEach((pkg: Patch) => { + for (let i = 0; i < json.patches.length; i++) { + json.patches[i].compatiblePackages.forEach((pkg: Patch) => { packagesWithCount[pkg.name] = (packagesWithCount[pkg.name] || 0) + 1; }); } @@ -67,7 +67,7 @@ async function patches(): Promise { .sort((a, b) => b[1] - a[1]) .map((pkg) => pkg[0]); - return { patches: json, packages }; + return { patches: json.patches, packages }; } export const staleTime = 5 * 60 * 1000;