Renamed publisher to publishers and added array
Also added publisher/serialization support for MALAPI MAnga
This commit is contained in:
parent
f3e0b32bb8
commit
4eee3704e8
4 changed files with 7 additions and 4 deletions
|
|
@ -41,7 +41,7 @@ export class ComicVineAPI extends APIModel {
|
|||
year: result.start_year,
|
||||
dataSource: this.apiName,
|
||||
id: result.id,
|
||||
publisher: result.publisher.name ?? 'unknown',
|
||||
publishers: result.publisher.name ?? [],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
|
@ -82,7 +82,7 @@ export class ComicVineAPI extends APIModel {
|
|||
image: result.image?.original_url ?? '',
|
||||
|
||||
released: true,
|
||||
publisher: result.publisher.name ?? '',
|
||||
publishers: result.publisher.map((x: any) => x.name) ?? [],
|
||||
publishedFrom: result.start_year ?? 'unknown',
|
||||
publishedTo: 'unknown',
|
||||
status: result.status,
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ export class MALAPIManga extends APIModel {
|
|||
image: result.images?.jpg?.image_url ?? '',
|
||||
|
||||
released: true,
|
||||
publishers: result.serializations?.map((x: any) => x.name) ?? [],
|
||||
publishedFrom: new Date(result.published?.from).toLocaleDateString() ?? 'unknown',
|
||||
publishedTo: new Date(result.published?.to).toLocaleDateString() ?? 'unknown',
|
||||
status: result.status,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export type ComicBookData = ModelToData<ComicBookModel>;
|
|||
|
||||
export class ComicBookModel extends MediaTypeModel {
|
||||
creators: string[];
|
||||
publisher: string;
|
||||
publishers: string[];
|
||||
plot: string;
|
||||
issues: number;
|
||||
image: string;
|
||||
|
|
@ -27,7 +27,7 @@ export class ComicBookModel extends MediaTypeModel {
|
|||
super();
|
||||
|
||||
this.creators = [];
|
||||
this.publisher = '';
|
||||
this.publishers = [];
|
||||
this.plot = '';
|
||||
this.issues = 0;
|
||||
this.image = '';
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ export class MangaModel extends MediaTypeModel {
|
|||
|
||||
released: boolean;
|
||||
status: string;
|
||||
publishers: string[];
|
||||
publishedFrom: string;
|
||||
publishedTo: string;
|
||||
|
||||
|
|
@ -40,6 +41,7 @@ export class MangaModel extends MediaTypeModel {
|
|||
|
||||
this.released = false;
|
||||
this.status = '';
|
||||
this.publishers = [];
|
||||
this.publishedFrom = '';
|
||||
this.publishedTo = '';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue