series for MAL

This commit is contained in:
mProjectsCode 2022-05-09 16:52:17 +02:00
parent c7a75ff93c
commit ac82168740
8 changed files with 101 additions and 80 deletions

View file

@ -6,4 +6,6 @@ export abstract class MediaTypeModel {
id: string;
abstract toMetaData(): string;
abstract getFileName(): string;
}

View file

@ -35,4 +35,8 @@ export class MovieModel extends MediaTypeModel {
return stringifyYaml(this);
}
getFileName(): string {
return this.title + (this.year ? ` (${this.year})` : '');
}
}

45
src/models/SeriesModel.ts Normal file
View file

@ -0,0 +1,45 @@
import {MediaTypeModel} from './MediaTypeModel';
import {stringifyYaml} from 'obsidian';
export class SeriesModel extends MediaTypeModel {
type: string;
title: string;
year: string;
dataSource: string;
id: string;
genres: string[];
studios: string[];
episodes: number;
duration: string;
onlineRating: number;
image: string;
released: boolean;
airing: boolean;
airedFrom: string;
airedTo: string;
watched: boolean;
lastWatched: string;
personalRating: number;
constructor(obj: any = {}) {
super();
Object.assign(this, obj);
this.type = 'series';
}
toMetaData(): string {
return stringifyYaml(this);
}
getFileName(): string {
return this.title;
}
}