relaxed image check

don't use fetch here - it doesn't work
This commit is contained in:
nikk gitanes
2021-08-10 09:33:08 +03:00
parent 136b3523b4
commit ef8bc07f57

View File

@@ -23,12 +23,12 @@ export const getMoviePosters = (movieName, language = 'en') => {
export const checkImageURL = async url => { export const checkImageURL = async url => {
if (!url || !url.match(/.(jpg|jpeg|png|gif)$/i)) return false if (!url || !url.match(/.(jpg|jpeg|png|gif)$/i)) return false
try { // try {
await fetch(url, { mode: 'no-cors' }) // await fetch(url, { mode: 'no-cors' })
return true return true
} catch (e) { // } catch (e) {
return false // return false
} // }
} }
const magnetRegex = /^magnet:\?xt=urn:[a-z0-9].*/i const magnetRegex = /^magnet:\?xt=urn:[a-z0-9].*/i