Frontend: Using MediaSelectorPipe for PersonCardComponent & added default-profile.png

This commit is contained in:
X4Lo committed 2025-07-12 02:57:34 +01:00
1 parent 9d8f2899d4
commit 6c2a437d7b
3 files changed
+3 -27

No files matched your search

@@ -19,39 +19,15 @@ export class PersonCardComponent implements OnInit {
ngOnInit() {}
getProfileImageUrl(): string {
if (!this.person) return this.defaultImage;
// First check if we have a local media
// if (this.person.medias && this.person.medias.length > 0) {
// const profileMedia = this.person.medias.find(m => m.type === 'profile');
// if (profileMedia) {
// return `${this.backendUrl}/images/people/profiles/${profileMedia.file_name}`;
// }
// }
// Fallback to TMDB image if available
if (this.person.profile_path) {
return `https://image.tmdb.org/t/p/w185${this.person.profile_path}`;
}
// Default image if nothing else is available
return this.defaultImage;
}
getGenderText(): string {
if (!this.person || this.person.gender === undefined)
return 'Not specified';
switch (this.person.gender) {
case 0:
return 'Not specified';
case 1:
return 'Female';
case 2:
return 'Male';
case 3:
return 'Non-binary';
default:
return 'Not specified';
}