series for MAL
This commit is contained in:
parent
c7a75ff93c
commit
ac82168740
8 changed files with 101 additions and 80 deletions
|
|
@ -6,4 +6,6 @@ export abstract class MediaTypeModel {
|
|||
id: string;
|
||||
|
||||
abstract toMetaData(): string;
|
||||
|
||||
abstract getFileName(): string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
45
src/models/SeriesModel.ts
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue