obsidian-media-db-sync/src/models/SeriesModel.ts
ltctceplrm 57de3d614c 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
2023-12-08 03:32:07 +01:00

80 lines
1.6 KiB
TypeScript

import { MediaTypeModel } from './MediaTypeModel';
import { mediaDbTag, migrateObject } from '../utils/Utils';
import { MediaType } from '../utils/MediaType';
export class SeriesModel extends MediaTypeModel {
type: string;
subType: string;
title: string;
englishTitle: string;
year: string;
dataSource: string;
url: string;
id: string;
plot: string;
genres: string[];
studios: string[];
episodes: number;
duration: string;
onlineRating: number;
actors: string[];
image: string;
released: boolean;
streamingServices: string[];
airing: boolean;
airedFrom: string;
airedTo: string;
userData: {
watched: boolean;
lastWatched: string;
personalRating: number;
};
constructor(obj: any = {}) {
super();
this.plot = undefined;
this.genres = undefined;
this.studios = undefined;
this.episodes = undefined;
this.duration = undefined;
this.onlineRating = undefined;
this.actors = undefined;
this.image = undefined;
this.released = undefined;
this.streamingServices = undefined;
this.airing = undefined;
this.airedFrom = undefined;
this.airedTo = undefined;
this.userData = {
watched: undefined,
lastWatched: undefined,
personalRating: undefined,
};
migrateObject(this, obj, this);
if (!obj.hasOwnProperty('userData')) {
migrateObject(this.userData, obj, this.userData);
}
this.type = this.getMediaType();
}
getTags(): string[] {
return [mediaDbTag, 'tv', 'series'];
}
getMediaType(): MediaType {
return MediaType.Series;
}
getSummary(): string {
return this.title + ' (' + this.year + ')';
}
}