Introduces a new movie importer feature allowing admins to search and import movies from IMDb, including new components for search, result display, and error handling. Replaces the schedule header with a reusable menu header component. Updates routing, navigation, and HTTP service to support the new importer. Adds a poster placeholder image and improves poster error handling.
22 lines
576 B
TypeScript
22 lines
576 B
TypeScript
import { Component, input } from '@angular/core';
|
|
import { Film } from '@infinimotion/model-frontend';
|
|
|
|
@Component({
|
|
selector: 'app-movie-poster',
|
|
standalone: false,
|
|
templateUrl: './movie-poster.component.html',
|
|
styleUrl: './movie-poster.component.css'
|
|
})
|
|
export class MoviePosterComponent {
|
|
movie = input.required<Film>();
|
|
|
|
onPosterError(event: Event) {
|
|
const img = event.target as HTMLImageElement;
|
|
const placeholder = 'assets/poster_placeholder.png';
|
|
|
|
if (img.src !== window.location.origin + placeholder) {
|
|
img.src = placeholder;
|
|
}
|
|
}
|
|
}
|