minor random fix/changes
This commit is contained in:
1 parent
9d89eda74c
commit
b35ab48b4f
8 files changed
+94
-104
No files matched your search
@@ -61,6 +61,15 @@
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
/* ! OVER LAY 1 HIDDEN MODE */
|
||||
.movie-card .card-body {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.movie-card:hover .card-body {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* ! OVER LAY 2 */
|
||||
.movie-card:hover .card-overlay-2 {
|
||||
opacity: 0;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<div class="movie-card" [@fadeInOut]="animationDirection">
|
||||
<div class="card-head">
|
||||
<img class="card-img" [src]="posterPath" alt="Movie Poster" onerror="this.src='assets/images/default/default-poster.png'">
|
||||
<img class="card-img" [src]="posterPath" alt="Movie Poster"
|
||||
onerror="this.src='assets/images/default/default-poster.png'">
|
||||
|
||||
<div class="loading-overlay" *ngIf="lockActions" @animateDestroy>
|
||||
<div class="d-flex justify-content-center align-items-center" style="height: 100%;">
|
||||
@@ -18,21 +19,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-overlay">
|
||||
<div class="card-overlay" (click)="cardClick()">
|
||||
<div class="rating">
|
||||
<i class='bx bx-star'></i>
|
||||
<span>{{formattedRate}}</span>
|
||||
</div>
|
||||
<div class="bookmark" *ngIf="!entry.isInLibrary">
|
||||
<i class='bx bxs-add-to-queue' (click)="addEntry(entry.entryId.tmdb_id, entry.is_tvseries)"></i>
|
||||
<i class='bx bxs-add-to-queue'
|
||||
(click)="addEntry(entry.entryId.tmdb_id, entry.is_tvseries); $event.stopPropagation()"></i>
|
||||
</div>
|
||||
<div class="bookmark" *ngIf="entry.isInLibrary">
|
||||
<i class='bx bxs-trash' (click)="removeEntry(entry.id)" style="color: #d42f50;"></i>
|
||||
<i class='bx bxs-trash' (click)="removeEntry(entry.id); $event.stopPropagation()" style="color: #d42f50;"></i>
|
||||
</div>
|
||||
|
||||
<!-- <div [ngClass]="{'info': !entry.isInLibrary, 'bookmark': entry.isInLibrary}"> -->
|
||||
<div class="info" *ngIf="entry.isInLibrary">
|
||||
<i class='bx bx-list-plus' (click)="showAddToListModal()"></i>
|
||||
<i class='bx bx-list-plus' (click)="showAddToListModal(); $event.stopPropagation()"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import { Entry } from '../../../models/entry.model';
|
||||
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';
|
||||
|
||||
@Component({
|
||||
selector: 'app-main-card',
|
||||
@@ -121,7 +122,7 @@ export class MainCardComponent implements OnInit {
|
||||
// console.log(`Entry added to library`, entry);
|
||||
entry.isInLibrary = true;
|
||||
this.entry = entry;
|
||||
this.libraryService.refrechEntries().subscribe();
|
||||
this.libraryService.refreshEntries().subscribe();
|
||||
this.onEntryUpdate.emit(this.entry.id);
|
||||
this.lockActions = false;
|
||||
obs.unsubscribe();
|
||||
@@ -131,6 +132,7 @@ export class MainCardComponent implements OnInit {
|
||||
// TODO error notification
|
||||
console.error('Error adding entry:', error);
|
||||
this.lockActions = false;
|
||||
obs.unsubscribe();
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -159,7 +161,7 @@ export class MainCardComponent implements OnInit {
|
||||
this.entry.id = 0;
|
||||
this.entry.isInLibrary = false;
|
||||
this.onEntryRemove.emit(this.entry.id);
|
||||
this.libraryService.refrechEntries().subscribe();
|
||||
this.libraryService.refreshEntries().subscribe();
|
||||
// todo entry removed notification
|
||||
},
|
||||
error: (error) => {
|
||||
@@ -219,12 +221,12 @@ export class MainCardComponent implements OnInit {
|
||||
get posterPath() {
|
||||
// * Not in library, use TMDB poster
|
||||
if (!this.entry.isInLibrary)
|
||||
return `https://image.tmdb.org/t/p/w300` + this.entry.poster_path;
|
||||
return `https://image.tmdb.org/t/p/w342` + this.entry.poster_path;
|
||||
|
||||
// * Is in library: use a local poster
|
||||
if (this.entry.medias) {
|
||||
const selectedPosters = this.entry.medias.filter(
|
||||
(m) => m.type == 'poster' && m.is_selected
|
||||
(m) => m.type == 'poster' && m.isSelected
|
||||
);
|
||||
|
||||
if (
|
||||
@@ -232,9 +234,8 @@ export class MainCardComponent implements OnInit {
|
||||
selectedPosters[0] &&
|
||||
selectedPosters[0].path
|
||||
) {
|
||||
const name = selectedPosters[0].path.split('.')[0];
|
||||
const extention = selectedPosters[0].path.split('.')[1];
|
||||
return `http://localhost:4000/api/v1/media/entries/posters/${name}_preview.${extention}`;
|
||||
const name = selectedPosters[0].path;
|
||||
return environment.API_URL + `/media/entries/posters/preview/${name}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+30
-49
@@ -1,57 +1,38 @@
|
||||
<!-- <h2 mat-dialog-title>Choose a list</h2>
|
||||
<mat-dialog-content>
|
||||
<mat-form-field appearance="fill">
|
||||
<mat-label>List Name</mat-label>
|
||||
<input [formControl]="searchControl" matInput>
|
||||
</mat-form-field>
|
||||
<mat-dialog-actions align="center" *ngIf="doShowAddButton()">
|
||||
<button mat-button (click)="createList()" *ngIf="doShowAddButton()">Create List</button>
|
||||
</mat-dialog-actions>
|
||||
<mat-selection-list #shoes (selectionChange)="onSelectionChange($event)">
|
||||
<mat-list-option *ngFor="let list of listsToShow" [value]="list.id" checkboxPosition="before">
|
||||
{{list.name}}
|
||||
</mat-list-option>
|
||||
</mat-selection-list>
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions align="end">
|
||||
<button mat-button [mat-dialog-close]="true">OK</button>
|
||||
<button mat-button mat-dialog-close>Cancel</button>
|
||||
</mat-dialog-actions> -->
|
||||
<div class="modal-content user-lists">
|
||||
<div class="modal-header">
|
||||
<h2 class="modal-title">Choose a Collection</h2>
|
||||
<button type="button" class="btn-close" (click)="closeDialog()"></button>
|
||||
<div class="card border-top border-3 border-primary rounded-0 media-dialog-main mb-0">
|
||||
<div class="modal-header card-header py-3 px-4">
|
||||
<h5 class="mb-0 text-primary">Add To Collection</h5>
|
||||
<button type="button" class="btn-close" aria-label="Close" (click)="onClose()"></button>
|
||||
</div>
|
||||
|
||||
<!-- Modal Body -->
|
||||
<div class="modal-body">
|
||||
<div class="input-group mb-3 ">
|
||||
<!-- <label for="listNameInput" class="form-label">List Name</label> -->
|
||||
<input type="text" class="form-control" id="listNameInput" [formControl]="searchControl"
|
||||
placeholder="Collection name..." @scaleInOut>
|
||||
<button class="btn btn-success growing-width-element" type="button" *ngIf="doShowAddButton()" (click)="createList()" @scaleInOut>Create
|
||||
Collection</button>
|
||||
<div class="card-body p-4">
|
||||
<div class="modal-body">
|
||||
<div class="input-group mb-3 ">
|
||||
<!-- <label for="listNameInput" class="form-label">List Name</label> -->
|
||||
<input type="text" class="form-control" id="listNameInput" [formControl]="searchControl"
|
||||
placeholder="Collection name..." @scaleInOut>
|
||||
<button class="btn btn-success growing-width-element" type="button" *ngIf="doShowAddButton()"
|
||||
(click)="createList()" @scaleInOut>Create
|
||||
Collection</button>
|
||||
|
||||
</div>
|
||||
<div class="d-grid gap-2" *ngIf="doShowAddButton()">
|
||||
</div>
|
||||
<div data-simplebar class="simplebar-content-wrapper">
|
||||
<div class="list-group">
|
||||
</div>
|
||||
<div class="d-grid gap-2" *ngIf="doShowAddButton()">
|
||||
</div>
|
||||
<div data-simplebar class="simplebar-content-wrapper">
|
||||
<div class="list-group">
|
||||
|
||||
<label *ngFor="let list of userCollectionsToShow" class="list-group-item">
|
||||
<input class="form-check-input me-1" type="checkbox" [value]="list.id"
|
||||
(change)="onSelectionChange(list, $event)" [checked]="list.isChecked">
|
||||
{{ list.name }}
|
||||
</label>
|
||||
<label *ngFor="let list of userCollectionsToShow" class="list-group-item">
|
||||
<input class="form-check-input me-1" type="checkbox" [value]="list.id"
|
||||
(change)="onSelectionChange(list, $event)" [checked]="list.isChecked">
|
||||
{{ list.name }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="d-md-flex d-grid align-items-end gap-3">
|
||||
<button type="button" class="btn btn-primary px-4 rounded-0" (click)="onSubmit()">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Footer -->
|
||||
<div class="modal-footer">
|
||||
<div class="btn-group">
|
||||
<!-- <button type="button" class="btn btn-secondary" (click)="closeDialog()">Cancel</button> -->
|
||||
<button type="button" class="btn btn-primary" (click)="confirmSelection()">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+13
-13
@@ -64,18 +64,21 @@ export class UserCollectionsModalComponent implements OnInit {
|
||||
|
||||
getLists() {
|
||||
this.listService.getCollections().subscribe({
|
||||
next: (c) => {
|
||||
c.forEach((collection) => {
|
||||
next: (result) => {
|
||||
result.forEach((collection) => {
|
||||
if (
|
||||
collection.userCollectionEntries.some(
|
||||
(entry) => entry.entry_id == this.entryId
|
||||
collection.entries.some(
|
||||
(entry) => entry.id == this.entryId
|
||||
)
|
||||
) {
|
||||
collection.isChecked = true;
|
||||
}
|
||||
});
|
||||
|
||||
this.userCollections = c;
|
||||
this.userCollections = result;
|
||||
this.userCollections = this.userCollections.filter(
|
||||
(c) => c.isUserCollection
|
||||
);
|
||||
this.userCollectionsToShow = this.userCollections;
|
||||
this.applyFilter(this.searchControl.value);
|
||||
},
|
||||
@@ -102,7 +105,7 @@ export class UserCollectionsModalComponent implements OnInit {
|
||||
}
|
||||
|
||||
createList() {
|
||||
const listName = this.searchControl.value; // string
|
||||
const listName = this.searchControl.value?.toString().trim(); // string
|
||||
|
||||
let myNewList = { name: listName } as UserCollection;
|
||||
|
||||
@@ -124,10 +127,7 @@ export class UserCollectionsModalComponent implements OnInit {
|
||||
`Adding Entry ${this.entryId} to list: ${userCollection.name}`
|
||||
);
|
||||
this.listService
|
||||
.addEntryToCollection(
|
||||
userCollection.id,
|
||||
this.entryId
|
||||
)
|
||||
.addEntryToCollection(userCollection.id, this.entryId)
|
||||
.subscribe({
|
||||
next: (response) => {
|
||||
console.log('Successfuly added Entry To Collection:', response);
|
||||
@@ -165,12 +165,12 @@ export class UserCollectionsModalComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
closeDialog(): void {
|
||||
onClose(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
confirmSelection(): void {
|
||||
this.dialogRef.close(/* Optionally pass back some data */);
|
||||
onSubmit(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
showNotification(title: string, message: string, type: string): void {
|
||||
|
||||
Reference in new issue
Block a user