diff --git a/frontend/src/app/shared/components/cards/main-card/main-card.component.html b/frontend/src/app/shared/components/cards/main-card/main-card.component.html index fdef01e..760dbb1 100644 --- a/frontend/src/app/shared/components/cards/main-card/main-card.component.html +++ b/frontend/src/app/shared/components/cards/main-card/main-card.component.html @@ -3,7 +3,7 @@ Movie Poster
-
+
beenhere diff --git a/frontend/src/app/shared/components/cards/main-card/main-card.component.ts b/frontend/src/app/shared/components/cards/main-card/main-card.component.ts index 2411aae..8ce1534 100644 --- a/frontend/src/app/shared/components/cards/main-card/main-card.component.ts +++ b/frontend/src/app/shared/components/cards/main-card/main-card.component.ts @@ -58,10 +58,11 @@ export class MainCardComponent implements OnInit { this.libraryService.addEntry(tmdb_id, is_tvserie).subscribe({ next: (entry) => { if (entry != null) { + console.log(`Entry added to library`, entry); entry.isInLibrary = true; this.entry = entry; + // todo emit event to > list > library to refrech this.libraryService.getAllEntries(true); - console.log(entry); } }, error: (error) => { @@ -74,10 +75,11 @@ export class MainCardComponent implements OnInit { console.log('Deleting Entry From Library.'); this.libraryService.deleteEntry(id).subscribe({ next: (response) => { - // Handle successful deletion console.log('Entry successfully deleted.', response); this.entry.id = 0; this.entry.isInLibrary = false; + // todo emit event to > list > library to refrech + this.libraryService.getAllEntries(true); }, error: (error) => { console.error('Error deleting entry:', error); @@ -111,6 +113,10 @@ export class MainCardComponent implements OnInit { return `https://www.themoviedb.org/${type}/${this.entry.entryId.tmdb_id}`; } + isCertainRoute(): boolean { + return this.router.isActive('/search', true) || this.router.isActive('/popular', true) || this.router.isActive('/trending', true); + } + get postPath() { if (this.entry.poster_path == null) return 'assets/images/default/default-poster.png';