Skip to content

Commit 57de3d6

Browse files
committed
Modified the PR by onesvat to add plot to media
I modified synopsis in manga to plot and added the plot in MALapi that also uses the movie model, I did the same thing for series
1 parent a31a619 commit 57de3d6

File tree

6 files changed

+13
-4
lines changed

6 files changed

+13
-4
lines changed

src/api/apis/MALAPI.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export class MALAPI extends APIModel {
108108
url: result.url,
109109
id: result.mal_id,
110110

111+
plot: result.synopsis,
111112
genres: result.genres?.map((x: any) => x.name) ?? [],
112113
producer: result.studios?.map((x: any) => x.name).join(', ') ?? 'unknown',
113114
duration: result.duration ?? 'unknown',
@@ -139,6 +140,7 @@ export class MALAPI extends APIModel {
139140
url: result.url,
140141
id: result.mal_id,
141142

143+
plot: result.synopsis,
142144
genres: result.genres?.map((x: any) => x.name) ?? [],
143145
producer: result.studios?.map((x: any) => x.name).join(', ') ?? 'unknown',
144146
duration: result.duration ?? 'unknown',

src/api/apis/MALAPIManga.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class MALAPIManga extends APIModel {
4848
new MangaModel({
4949
subType: type,
5050
title: result.title,
51-
synopsis: result.synopsis,
51+
plot: result.synopsis,
5252
englishTitle: result.title_english ?? result.title,
5353
alternateTitles: result.titles?.map((x: any) => x.title) ?? [],
5454
year: result.year ?? result.published?.prop?.from?.year ?? '',
@@ -98,14 +98,14 @@ export class MALAPIManga extends APIModel {
9898
const model = new MangaModel({
9999
subType: type,
100100
title: result.title,
101-
synopsis: result.synopsis,
102101
englishTitle: result.title_english ?? result.title,
103102
alternateTitles: result.titles?.map((x: any) => x.title) ?? [],
104103
year: result.year ?? result.published?.prop?.from?.year ?? '',
105104
dataSource: this.apiName,
106105
url: result.url,
107106
id: result.mal_id,
108107

108+
plot: result.synopsis,
109109
genres: result.genres?.map((x: any) => x.name) ?? [],
110110
authors: result.authors?.map((x: any) => x.name) ?? [],
111111
chapters: result.chapters,

src/api/apis/OMDbAPI.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export class OMDbAPI extends APIModel {
134134
url: `https://www.imdb.com/title/${result.imdbID}/`,
135135
id: result.imdbID,
136136

137+
plot: result.Plot ?? '',
137138
genres: result.Genre?.split(', ') ?? [],
138139
producer: result.Director ?? 'unknown',
139140
duration: result.Runtime ?? 'unknown',
@@ -163,6 +164,7 @@ export class OMDbAPI extends APIModel {
163164
url: `https://www.imdb.com/title/${result.imdbID}/`,
164165
id: result.imdbID,
165166

167+
plot: result.Plot ?? '',
166168
genres: result.Genre?.split(', ') ?? [],
167169
studios: [result.Director] ?? 'unknown',
168170
episodes: 0,

src/models/MangaModel.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class MangaModel extends MediaTypeModel {
66
type: string;
77
subType: string;
88
title: string;
9-
synopsis: string;
9+
plot: string;
1010
englishTitle: string;
1111
alternateTitles: string[];
1212
year: string;
@@ -35,6 +35,7 @@ export class MangaModel extends MediaTypeModel {
3535
constructor(obj: any = {}) {
3636
super();
3737

38+
this.plot = undefined;
3839
this.genres = undefined;
3940
this.authors = undefined;
4041
this.alternateTitles = undefined;

src/models/MovieModel.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { mediaDbTag, migrateObject } from '../utils/Utils';
33
import { MediaType } from '../utils/MediaType';
44

55
export class MovieModel extends MediaTypeModel {
6+
plot: string;
67
genres: string[];
78
producer: string;
89
duration: string;
@@ -23,6 +24,7 @@ export class MovieModel extends MediaTypeModel {
2324
constructor(obj: any = {}) {
2425
super();
2526

27+
this.plot = undefined;
2628
this.genres = undefined;
2729
this.producer = undefined;
2830
this.duration = undefined;
@@ -60,4 +62,4 @@ export class MovieModel extends MediaTypeModel {
6062
getSummary(): string {
6163
return this.englishTitle + ' (' + this.year + ')';
6264
}
63-
}
65+
}

src/models/SeriesModel.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export class SeriesModel extends MediaTypeModel {
1212
url: string;
1313
id: string;
1414

15+
plot: string;
1516
genres: string[];
1617
studios: string[];
1718
episodes: number;
@@ -35,6 +36,7 @@ export class SeriesModel extends MediaTypeModel {
3536
constructor(obj: any = {}) {
3637
super();
3738

39+
this.plot = undefined;
3840
this.genres = undefined;
3941
this.studios = undefined;
4042
this.episodes = undefined;

0 commit comments

Comments
 (0)