- Correction du dropdown toolbar : prop align (left/right) pour éviter le débordement hors écran côté droit - Filtre de collection par statut (all/completed/ongoing) persisté dans userPreferencesStore - toolbarConfig rendu réactif (computed) avec isSelected sur Filter, Sort et View - Modale Options d'affichage par vue (Grille, Overview, Table) avec toggles persistés - Composant ToggleRow réutilisable - Normalisation author → authors dans l'entité Manga (l'API renvoie author string)
51 lines
1.2 KiB
JavaScript
51 lines
1.2 KiB
JavaScript
export class Manga {
|
|
constructor({
|
|
id,
|
|
slug,
|
|
title,
|
|
description = null,
|
|
author = null,
|
|
authors = [],
|
|
imageUrl = null,
|
|
thumbnailUrl = null,
|
|
publicationYear = null,
|
|
status = null,
|
|
rating = null,
|
|
genres = [],
|
|
createdAt = new Date().toISOString(),
|
|
monitored = false,
|
|
chaptersTotal = 0,
|
|
chaptersScraped = 0,
|
|
}) {
|
|
this.id = id;
|
|
this.slug = slug;
|
|
this.title = title;
|
|
this.description = description;
|
|
this.authors = authors.length ? authors : (author ? [author] : []);
|
|
this.imageUrl = imageUrl;
|
|
this.thumbnailUrl = thumbnailUrl;
|
|
this.publicationYear = publicationYear;
|
|
this.status = status;
|
|
this.rating = rating;
|
|
this.genres = genres;
|
|
this.createdAt = createdAt;
|
|
this.monitored = monitored;
|
|
this.chaptersTotal = chaptersTotal;
|
|
this.chaptersScraped = chaptersScraped;
|
|
}
|
|
|
|
static create(data) {
|
|
return new Manga(data);
|
|
}
|
|
}
|
|
|
|
export class MangaCollection {
|
|
constructor(items, total, page, limit, hasNextPage, hasPreviousPage) {
|
|
this.items = items.map(item => Manga.create(item));
|
|
this.total = total;
|
|
this.page = page;
|
|
this.limit = limit;
|
|
this.hasNextPage = hasNextPage;
|
|
this.hasPreviousPage = hasPreviousPage;
|
|
}
|
|
}
|