removed the in library badge from library pages
This commit is contained in:
1 parent
a3f1b16376
commit
1425f0e425
2 files changed
+9
-3
No files matched your search
@@ -3,7 +3,7 @@
|
||||
<img class="card-img" [src]="postPath" alt="Movie Poster">
|
||||
|
||||
<div class="card-overlay-2">
|
||||
<div class="in-library" *ngIf="entry.isInLibrary">
|
||||
<div class="in-library" *ngIf="entry.isInLibrary && isCertainRoute()">
|
||||
<span class="material-symbols-outlined">
|
||||
beenhere
|
||||
</span>
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in new issue
Block a user