Random changes
This commit is contained in:
1 parent
7160669468
commit
0b1a1d989f
17 files changed
+205
-159
No files matched your search
@@ -1,4 +1,5 @@
|
||||
<div class="movie-card" [@fadeInOut]="animationDirection">
|
||||
<div class="movie-card" [@fadeInOut]="animationDirection" appContextMenuTrigger
|
||||
[menuOptions]="contextMenuOptions">
|
||||
<div class="card-head">
|
||||
<img class="card-img" [src]="posterPath" alt="Movie Poster"
|
||||
onerror="this.src='assets/images/default/default-poster.png'">
|
||||
|
||||
@@ -13,6 +13,7 @@ import { LibraryService } from '../../../../core/services/library.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { ConfirmModalComponent } from '../../modals/confirm-modal/confirm-modal.component';
|
||||
import { environment } from '../../../../../environments/environment.prod';
|
||||
import { CONTEXT_MENU_OPTIONS } from '../../../constants/context-menu-options';
|
||||
|
||||
@Component({
|
||||
selector: 'app-main-card',
|
||||
@@ -251,4 +252,22 @@ export class MainCardComponent implements OnInit {
|
||||
if (this.entry.runtime == null) return '';
|
||||
return this.entry.runtime;
|
||||
}
|
||||
|
||||
get contextMenuOptions() {
|
||||
let options = [];
|
||||
|
||||
// ? 1 - is in library
|
||||
if (this.entry.isInLibrary) {
|
||||
if (this.entry.watchlist) {
|
||||
options.push(CONTEXT_MENU_OPTIONS.removeFromWatchlist);
|
||||
} else {
|
||||
options.push(CONTEXT_MENU_OPTIONS.addToWatchlist);
|
||||
}
|
||||
} else {
|
||||
// ? 2 - not in library
|
||||
options.push(CONTEXT_MENU_OPTIONS.addToLibrary);
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user