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.

Increase silly text chance and replace backend url with env var

+11 -8
+2 -2
src/hooks/useRandomTranslation.ts
··· 1 1 import { useCallback, useMemo } from "react"; 2 2 import { useTranslation } from "react-i18next"; 3 3 4 - // 10% chance of getting a joke title 5 - const shouldGiveJokeTitle = () => Math.floor(Math.random() * 10) === 0; 4 + // 35% chance of getting a joke title (Cooper done changed this code!) 5 + const shouldGiveJokeTitle = () => Math.random() < 0.35; 6 6 7 7 export function useRandomTranslation() { 8 8 const { t } = useTranslation();
+4 -3
src/pages/TopFlix.tsx
··· 5 5 import { ThiccContainer } from "@/components/layout/ThinContainer"; 6 6 import { Divider } from "@/components/utils/Divider"; 7 7 import { Heading1, Paragraph } from "@/components/utils/Text"; 8 + import { BACKEND_URL } from "@/setup/constants"; 8 9 9 10 import { SubPageLayout } from "./layouts/SubPageLayout"; 10 11 import { PageTitle } from "./parts/util/PageTitle"; ··· 84 85 } 85 86 86 87 async function getRecentPlayedItems() { 87 - const response = await fetch("https://backend.sudo-flix.lol/metrics"); 88 + const response = await fetch(BACKEND_URL); 88 89 const text = await response.text(); 89 90 90 91 const regex = ··· 118 119 } 119 120 120 121 async function getTotalViews() { 121 - const response = await fetch("https://backend.sudo-flix.lol/metrics"); 122 + const response = await fetch(BACKEND_URL); 122 123 const text = await response.text(); 123 124 124 125 // Add up all mw_media_watch_count entries ··· 138 139 } 139 140 140 141 function getProcessStartTime(): Promise<string> { 141 - return fetch("https://backend.sudo-flix.lol/metrics") 142 + return fetch(BACKEND_URL) 142 143 .then((response) => response.text()) 143 144 .then((text) => { 144 145 const regex = /process_start_time_seconds (\d+)/;
+2 -1
src/pages/TopSources.tsx
··· 4 4 import { ThiccContainer } from "@/components/layout/ThinContainer"; 5 5 import { Divider } from "@/components/utils/Divider"; 6 6 import { Heading1, Paragraph } from "@/components/utils/Text"; 7 + import { BACKEND_URL } from "@/setup/constants"; 7 8 8 9 import { SubPageLayout } from "./layouts/SubPageLayout"; 9 10 import { PageTitle } from "./parts/util/PageTitle"; ··· 24 25 } 25 26 26 27 async function getTopSources() { 27 - const response = await fetch("https://backend.sudo-flix.lol/metrics"); 28 + const response = await fetch(BACKEND_URL); 28 29 const text = await response.text(); 29 30 30 31 const regex =
+3 -2
src/pages/parts/admin/ConfigValuesPart.tsx
··· 3 3 import { Divider } from "@/components/utils/Divider"; 4 4 import { Heading2 } from "@/components/utils/Text"; 5 5 import { conf } from "@/setup/config"; 6 + import { BACKEND_URL } from "@/setup/constants"; 6 7 7 8 async function getAccountNumber() { 8 - const response = await fetch("https://backend.sudo-flix.lol/metrics"); 9 + const response = await fetch(BACKEND_URL); 9 10 const text = await response.text(); 10 11 11 12 // Adjusted regex to match any hostname ··· 26 27 } 27 28 28 29 async function getAllAccounts() { 29 - const response = await fetch("https://backend.sudo-flix.lol/metrics"); 30 + const response = await fetch(BACKEND_URL); 30 31 const text = await response.text(); 31 32 32 33 const regex = /mw_user_count{namespace="movie-web"} (\d+)/;