Skip to content

Commit

Permalink
refactor ♻️ : pref
Browse files Browse the repository at this point in the history
  • Loading branch information
HerbertHe committed Jan 14, 2024
1 parent 4347c2a commit 85ab9eb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/checker/caniuse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const canIUseM3uFile = (f: string) => {
export const canIUseIPTVChecker = async () => {
const { ENABLE_IPTV_CHECKER, IPTV_CHECKER_URL } = process.env

if (!Boolean(ENABLE_IPTV_CHECKER) || !IPTV_CHECKER_URL) return false
if (ENABLE_IPTV_CHECKER !== "true" || !IPTV_CHECKER_URL) return false

try {
const res = await fetch(IPTV_CHECKER_URL)
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Promise.allSettled(
} else {
// rollback failed
console.log(`[WARNING] m3u ${sr.name} get failed!`)
return ["rollback", undefined]
return ["rollback", void 0]
}
}
})
Expand Down Expand Up @@ -78,7 +78,7 @@ Promise.allSettled(
} else {
// rollback failed
console.log(`[WARNING] EPG ${epg_sr.name} get failed!`)
return [undefined]
return [void 0]
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/sources/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const handle_m3u = (r: string) => {
}

export const with_github_raw_url_proxy = (u: string) => {
return Boolean(process.env.CLOSE_SOURCE_PROXY)
return process.env.CLOSE_SOURCE_PROXY?.trim() === "true"
? u
: `${get_github_raw_proxy_url()}/${u}`
}

0 comments on commit 85ab9eb

Please sign in to comment.