Skip to content

Commit 4eee370

Browse files
committed
Renamed publisher to publishers and added array
Also added publisher/serialization support for MALAPI MAnga
1 parent f3e0b32 commit 4eee370

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/api/apis/ComicVineAPI.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class ComicVineAPI extends APIModel {
4141
year: result.start_year,
4242
dataSource: this.apiName,
4343
id: result.id,
44-
publisher: result.publisher.name ?? 'unknown',
44+
publishers: result.publisher.name ?? [],
4545
}),
4646
);
4747
}
@@ -82,7 +82,7 @@ export class ComicVineAPI extends APIModel {
8282
image: result.image?.original_url ?? '',
8383

8484
released: true,
85-
publisher: result.publisher.name ?? '',
85+
publishers: result.publisher.map((x: any) => x.name) ?? [],
8686
publishedFrom: result.start_year ?? 'unknown',
8787
publishedTo: 'unknown',
8888
status: result.status,

src/api/apis/MALAPIManga.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export class MALAPIManga extends APIModel {
114114
image: result.images?.jpg?.image_url ?? '',
115115

116116
released: true,
117+
publishers: result.serializations?.map((x: any) => x.name) ?? [],
117118
publishedFrom: new Date(result.published?.from).toLocaleDateString() ?? 'unknown',
118119
publishedTo: new Date(result.published?.to).toLocaleDateString() ?? 'unknown',
119120
status: result.status,

src/models/ComicBookModel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export type ComicBookData = ModelToData<ComicBookModel>;
77

88
export class ComicBookModel extends MediaTypeModel {
99
creators: string[];
10-
publisher: string;
10+
publishers: string[];
1111
plot: string;
1212
issues: number;
1313
image: string;
@@ -27,7 +27,7 @@ export class ComicBookModel extends MediaTypeModel {
2727
super();
2828

2929
this.creators = [];
30-
this.publisher = '';
30+
this.publishers = [];
3131
this.plot = '';
3232
this.issues = 0;
3333
this.image = '';

src/models/MangaModel.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export class MangaModel extends MediaTypeModel {
1717

1818
released: boolean;
1919
status: string;
20+
publishers: string[];
2021
publishedFrom: string;
2122
publishedTo: string;
2223

@@ -40,6 +41,7 @@ export class MangaModel extends MediaTypeModel {
4041

4142
this.released = false;
4243
this.status = '';
44+
this.publishers = [];
4345
this.publishedFrom = '';
4446
this.publishedTo = '';
4547

0 commit comments

Comments
 (0)