From 2894a92af1f719de81691b5b1e878c420f0532da Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 30 Aug 2019 10:10:31 +0900 Subject: [PATCH] Made image loading more reliable --- scripts/AnimeNotifier.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/AnimeNotifier.ts b/scripts/AnimeNotifier.ts index 3670d483..327527b8 100644 --- a/scripts/AnimeNotifier.ts +++ b/scripts/AnimeNotifier.ts @@ -908,6 +908,13 @@ export default class AnimeNotifier { } element.onerror = () => { + // Try loading from the origin server if our CDN failed + if(element.src.includes("media.notify.moe/")) { + console.warn(`CDN failed loading ${element.src}`) + element.src = element.src.replace("media.notify.moe/", "notify.moe/") + return + } + if(element.classList.contains("element-found")) { return }