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">
|
<img class="card-img" [src]="postPath" alt="Movie Poster">
|
||||||
|
|
||||||
<div class="card-overlay-2">
|
<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">
|
<span class="material-symbols-outlined">
|
||||||
beenhere
|
beenhere
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -58,10 +58,11 @@ export class MainCardComponent implements OnInit {
|
|||||||
this.libraryService.addEntry(tmdb_id, is_tvserie).subscribe({
|
this.libraryService.addEntry(tmdb_id, is_tvserie).subscribe({
|
||||||
next: (entry) => {
|
next: (entry) => {
|
||||||
if (entry != null) {
|
if (entry != null) {
|
||||||
|
console.log(`Entry added to library`, entry);
|
||||||
entry.isInLibrary = true;
|
entry.isInLibrary = true;
|
||||||
this.entry = entry;
|
this.entry = entry;
|
||||||
|
// todo emit event to > list > library to refrech
|
||||||
this.libraryService.getAllEntries(true);
|
this.libraryService.getAllEntries(true);
|
||||||
console.log(entry);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: (error) => {
|
error: (error) => {
|
||||||
@@ -74,10 +75,11 @@ export class MainCardComponent implements OnInit {
|
|||||||
console.log('Deleting Entry From Library.');
|
console.log('Deleting Entry From Library.');
|
||||||
this.libraryService.deleteEntry(id).subscribe({
|
this.libraryService.deleteEntry(id).subscribe({
|
||||||
next: (response) => {
|
next: (response) => {
|
||||||
// Handle successful deletion
|
|
||||||
console.log('Entry successfully deleted.', response);
|
console.log('Entry successfully deleted.', response);
|
||||||
this.entry.id = 0;
|
this.entry.id = 0;
|
||||||
this.entry.isInLibrary = false;
|
this.entry.isInLibrary = false;
|
||||||
|
// todo emit event to > list > library to refrech
|
||||||
|
this.libraryService.getAllEntries(true);
|
||||||
},
|
},
|
||||||
error: (error) => {
|
error: (error) => {
|
||||||
console.error('Error deleting entry:', 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}`;
|
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() {
|
get postPath() {
|
||||||
if (this.entry.poster_path == null)
|
if (this.entry.poster_path == null)
|
||||||
return 'assets/images/default/default-poster.png';
|
return 'assets/images/default/default-poster.png';
|
||||||
|
|||||||
Reference in new issue
Block a user