Adds getSummary to the MediaTypeModel.ts abstract class, which allows individual models to give more detail to better allow people to pick the right result
50 lines
865 B
TypeScript
50 lines
865 B
TypeScript
import {MediaTypeModel} from './MediaTypeModel';
|
|
import {mediaDbTag} from '../utils/Utils';
|
|
import {MediaType} from '../utils/MediaType';
|
|
|
|
|
|
export class MovieModel extends MediaTypeModel {
|
|
type: string;
|
|
subType: string;
|
|
title: string;
|
|
englishTitle: string;
|
|
year: string;
|
|
dataSource: string;
|
|
url: string;
|
|
id: string;
|
|
|
|
genres: string[];
|
|
producer: string;
|
|
duration: string;
|
|
onlineRating: number;
|
|
image: string;
|
|
|
|
released: boolean;
|
|
premiere: string;
|
|
|
|
userData: {
|
|
watched: boolean;
|
|
lastWatched: string;
|
|
personalRating: number;
|
|
};
|
|
|
|
constructor(obj: any = {}) {
|
|
super();
|
|
|
|
Object.assign(this, obj);
|
|
|
|
this.type = this.getMediaType();
|
|
}
|
|
|
|
getTags(): string[] {
|
|
return [mediaDbTag, 'tv', 'movie'];
|
|
}
|
|
|
|
getMediaType(): MediaType {
|
|
return MediaType.Movie;
|
|
}
|
|
|
|
getSummary(): string {
|
|
return this.englishTitle + ' (' + this.year + ')';
|
|
}
|
|
}
|