chore: remove node-fetch, fix lint issues

This commit is contained in:
Jef LeCompte
2025-07-18 23:25:07 -07:00
parent 206be57e8f
commit 4c22bfa9e2
5 changed files with 210 additions and 273 deletions

View File

@@ -101,15 +101,17 @@ function buildUrl() {
export async function getTVListings(): Promise<GridApiResponse> {
console.log("Fetching TV listings");
const response = await fetch(buildUrl(), {
const url = buildUrl();
const response = await fetch(url, {
headers: {
"User-Agent": config.userAgent,
"User-Agent": config.userAgent || "",
},
});
if (!response.ok) {
throw new Error(
`Failed to fetch: ${response.status} ${response.statusText}`
`Failed to fetch: ${response.status} ${response.statusText}`,
);
}