pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

update check to use location

Pas bb2fce75 d9bd48a6

+33 -1
+33 -1
src/pages/parts/settings/SetupPart.tsx
··· 19 19 import { conf } from "@/setup/config"; 20 20 import { useAuthStore } from "@/stores/auth"; 21 21 22 + const getRegion = (): string | null => { 23 + if (typeof window === "undefined") return null; 24 + try { 25 + const regionData = window.localStorage.getItem("__MW::region"); 26 + if (!regionData) return null; 27 + const parsed = JSON.parse(regionData); 28 + return parsed?.state?.region || null; 29 + } catch { 30 + return null; 31 + } 32 + }; 33 + 34 + const getBaseUrl = (): string => { 35 + const region = getRegion(); 36 + switch (region) { 37 + case "us-east": 38 + return "https://fed-api-east.pstream.org"; 39 + case "us-west": 40 + return "https://fed-api-west.pstream.org"; 41 + case "south-america": 42 + return "https://fed-api-south.pstream.org"; 43 + case "asia": 44 + return "https://fed-api-asia.pstream.org"; 45 + case "europe": 46 + return "https://fed-api-europe.pstream.org"; 47 + default: 48 + return "https://fed-api-east.pstream.org"; 49 + } 50 + }; 51 + 52 + const BASE_URL = getBaseUrl(); 53 + 22 54 const testUrl = "https://postman-echo.com/get"; 23 - const febboxApiTestUrl = "https://fed-api.pstream.org/movie/tt15239678"; 55 + const febboxApiTestUrl = `${BASE_URL}/movie//tt0325980`; 24 56 25 57 const sleep = (ms: number): Promise<void> => { 26 58 return new Promise((resolve) => {