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,
|
year: result.start_year,
|
||||||
dataSource: this.apiName,
|
dataSource: this.apiName,
|
||||||
id: result.id,
|
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 ?? '',
|
image: result.image?.original_url ?? '',
|
||||||
|
|
||||||
released: true,
|
released: true,
|
||||||
publisher: result.publisher.name ?? '',
|
publishers: result.publisher.map((x: any) => x.name) ?? [],
|
||||||
publishedFrom: result.start_year ?? 'unknown',
|
publishedFrom: result.start_year ?? 'unknown',
|
||||||
publishedTo: 'unknown',
|
publishedTo: 'unknown',
|
||||||
status: result.status,
|
status: result.status,
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@ export class MALAPIManga extends APIModel {
|
||||||
image: result.images?.jpg?.image_url ?? '',
|
image: result.images?.jpg?.image_url ?? '',
|
||||||
|
|
||||||
released: true,
|
released: true,
|
||||||
|
publishers: result.serializations?.map((x: any) => x.name) ?? [],
|
||||||
publishedFrom: new Date(result.published?.from).toLocaleDateString() ?? 'unknown',
|
publishedFrom: new Date(result.published?.from).toLocaleDateString() ?? 'unknown',
|
||||||
publishedTo: new Date(result.published?.to).toLocaleDateString() ?? 'unknown',
|
publishedTo: new Date(result.published?.to).toLocaleDateString() ?? 'unknown',
|
||||||
status: result.status,
|
status: result.status,
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ export type ComicBookData = ModelToData<ComicBookModel>;
|
||||||
|
|
||||||
export class ComicBookModel extends MediaTypeModel {
|
export class ComicBookModel extends MediaTypeModel {
|
||||||
creators: string[];
|
creators: string[];
|
||||||
publisher: string;
|
publishers: string[];
|
||||||
plot: string;
|
plot: string;
|
||||||
issues: number;
|
issues: number;
|
||||||
image: string;
|
image: string;
|
||||||
|
|
@ -27,7 +27,7 @@ export class ComicBookModel extends MediaTypeModel {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.creators = [];
|
this.creators = [];
|
||||||
this.publisher = '';
|
this.publishers = [];
|
||||||
this.plot = '';
|
this.plot = '';
|
||||||
this.issues = 0;
|
this.issues = 0;
|
||||||
this.image = '';
|
this.image = '';
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ export class MangaModel extends MediaTypeModel {
|
||||||
|
|
||||||
released: boolean;
|
released: boolean;
|
||||||
status: string;
|
status: string;
|
||||||
|
publishers: string[];
|
||||||
publishedFrom: string;
|
publishedFrom: string;
|
||||||
publishedTo: string;
|
publishedTo: string;
|
||||||
|
|
||||||
|
|
@ -40,6 +41,7 @@ export class MangaModel extends MediaTypeModel {
|
||||||
|
|
||||||
this.released = false;
|
this.released = false;
|
||||||
this.status = '';
|
this.status = '';
|
||||||
|
this.publishers = [];
|
||||||
this.publishedFrom = '';
|
this.publishedFrom = '';
|
||||||
this.publishedTo = '';
|
this.publishedTo = '';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue