Major rework of media handelling, and collections

This commit is contained in:
X4Lo committed 2024-09-13 21:27:01 +01:00
1 parent b42e055691
commit f7cb2bed53
37 files changed
+1120 -411

No files matched your search

@@ -1,7 +1,7 @@
import { Component, Inject, Input, OnInit, ViewChild } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { UserCollectionService } from '../../../../core/services/userCollection.service';
import { CollectionService } from '../../../../core/services/userCollection.service';
import { NotificationPopupComponent } from '../../notification-popup/notification-popup.component';
import { NotificationService } from '../../../services/notification.service';
import { UserCollection } from '../../../models/userCollection.model';
@@ -49,7 +49,7 @@ export class UserCollectionsModalComponent implements OnInit {
constructor(
public dialogRef: MatDialogRef<UserCollectionsModalComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
private listService: UserCollectionService,
private listService: CollectionService,
private notificationService: NotificationService
) {}
@@ -3,6 +3,7 @@ import { EntryRating } from './entryRating.model';
import { EntrySeen } from './entrySeen.model';
import { Media } from './media.model';
import { Season } from './season.model';
import { UserCollection } from './userCollection.model';
export interface Entry {
id: number;
@@ -11,6 +12,7 @@ export interface Entry {
entryRating: EntryRating;
entrySeen: EntrySeen[];
seasons: Season[];
collections: UserCollection[];
title: string;
original_title: string;
@@ -4,6 +4,8 @@ export interface Media {
id: number;
entry_id: number;
mediaable: string;
mediaableId: number;
entry: Entry;
type: string;
@@ -1,4 +1,5 @@
import { CollectionEntry } from './dtos/collection-entry.dto';
import { Media } from './media.model';
import { UserCollectionEntry } from './userCollectionEntry.model';
export interface UserCollection {
@@ -12,6 +13,7 @@ export interface UserCollection {
isUserCollection: boolean;
userRating: number;
medias: Media[];
posterPath: string;
backdropPath: string;
isLocal: boolean;
@@ -21,6 +23,12 @@ export interface UserCollection {
changed: boolean;
isChecked: boolean;
// * Processed fields
mediasCount: number;
entriesCount: number;
selectedPoster: string;
selectedBackdrop: string;
createdAt: Date;
updatedAt: Date;
}