From 1425f0e425a1bbb9c7084b16bac923828070d758 Mon Sep 17 00:00:00 2001 From: Mohammed Abad Date: Sun, 28 Apr 2024 00:21:47 +0100 Subject: [PATCH] removed the in library badge from library pages --- .../cards/main-card/main-card.component.html | 2 +- .../components/cards/main-card/main-card.component.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) 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';