diff --git a/src/Ombi/ClientApp/src/app/app.module.ts b/src/Ombi/ClientApp/src/app/app.module.ts
index 30f4b2ea6..24644d1df 100644
--- a/src/Ombi/ClientApp/src/app/app.module.ts
+++ b/src/Ombi/ClientApp/src/app/app.module.ts
@@ -68,7 +68,7 @@ import { TooltipModule } from "primeng/tooltip";
import { TranslateHttpLoader } from "@ngx-translate/http-loader";
import { TranslateService } from "@ngx-translate/core";
import { UnauthorizedInterceptor } from "./auth/unauthorized.interceptor";
-import { ImageBackgroundComponent } from "./components/";
+import { ImageBackgroundComponent, ImageComponent } from "./components/";
import { environment } from "../environments/environment";
const routes: Routes = [
@@ -168,7 +168,8 @@ export function JwtTokenGetter() {
[
NgxsReduxDevtoolsPluginModule.forRoot(),
],
- ImageBackgroundComponent
+ ImageBackgroundComponent,
+ ImageComponent,
],
declarations: [
AppComponent,
diff --git a/src/Ombi/ClientApp/src/app/components/image/image.component.html b/src/Ombi/ClientApp/src/app/components/image/image.component.html
new file mode 100644
index 000000000..3d5553313
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/components/image/image.component.html
@@ -0,0 +1 @@
+
diff --git a/src/Ombi/ClientApp/src/app/components/image/image.component.ts b/src/Ombi/ClientApp/src/app/components/image/image.component.ts
new file mode 100644
index 000000000..57099016a
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/components/image/image.component.ts
@@ -0,0 +1,57 @@
+import { OmbiCommonModules } from "../modules";
+import { ChangeDetectionStrategy, Component, ElementRef, Inject, Input, ViewEncapsulation } from "@angular/core";
+import { RequestType } from "../../interfaces";
+import { APP_BASE_HREF } from "@angular/common";
+
+@Component({
+ standalone: true,
+ selector: 'ombi-image',
+ imports: [...OmbiCommonModules],
+ encapsulation: ViewEncapsulation.None,
+ changeDetection: ChangeDetectionStrategy.OnPush,
+ templateUrl: './image.component.html',
+ })
+ export class ImageComponent {
+
+ @Input() public src: string;
+ @Input() public type: RequestType;
+
+ // Attributes from the parent
+ @Input() public class: string;
+ @Input() public id: string;
+ @Input() public alt: string;
+ @Input() public style: string;
+
+ public baseUrl: string = "";
+
+ public defaultTv = "/images/default_tv_poster.png";
+ private defaultMovie = "/images/default_movie_poster.png";
+ private defaultMusic = "i/mages/default-music-placeholder.png";
+
+ constructor (@Inject(APP_BASE_HREF) public href: string) {
+ if (this.href.length > 1) {
+ this.baseUrl = this.href;
+ }
+ }
+
+ public onError(event: any) {
+ // set to a placeholder
+ switch(this.type) {
+ case RequestType.movie:
+ event.target.src = this.baseUrl + this.defaultMovie;
+ break;
+ case RequestType.tvShow:
+ event.target.src = this.baseUrl + this.defaultTv;
+ break;
+ case RequestType.album:
+ event.target.src = this.baseUrl + this.defaultMusic;
+ break;
+ }
+
+ // Retry the original image
+ const timeout = setTimeout(() => {
+ event.target.src = this.src;
+ clearTimeout(timeout);
+ }, Math.floor(Math.random() * (7000 - 1000 + 1)) + 1000);
+ }
+ }
\ No newline at end of file
diff --git a/src/Ombi/ClientApp/src/app/components/index.ts b/src/Ombi/ClientApp/src/app/components/index.ts
index 75334a9e4..092f6504b 100644
--- a/src/Ombi/ClientApp/src/app/components/index.ts
+++ b/src/Ombi/ClientApp/src/app/components/index.ts
@@ -1 +1,2 @@
-export * from "./image-background/image-background.component";
\ No newline at end of file
+export * from "./image-background/image-background.component";
+export * from "./image/image.component";
\ No newline at end of file
diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.html b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.html
index d7ffbb6c1..a479b5072 100644
--- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.html
+++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.html
@@ -9,7 +9,7 @@
{{getAvailabilityStatus()}}
-
+