diff --git a/src/models/ComicBookModel.ts b/src/models/ComicBookModel.ts deleted file mode 100644 index 27c66bf..0000000 --- a/src/models/ComicBookModel.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { MediaType } from '../utils/MediaType'; -import type { ModelToData } from '../utils/Utils'; -import { mediaDbTag, migrateObject } from '../utils/Utils'; -import { MediaTypeModel } from './MediaTypeModel'; - -export type ComicBookData = ModelToData; - -export class ComicBookModel extends MediaTypeModel { - creators: string[]; - publishers: string[]; - plot: string; - issues: number; - image: string; - onlineRating: number; - status: string; - released: boolean; - publishedFrom: string; - publishedTo: string; - - userData: { - read: boolean; - lastRead: string; - personalRating: number; - }; - - constructor(obj: ComicBookData) { - super(); - - this.creators = []; - this.publishers = []; - this.plot = ''; - this.issues = 0; - this.image = ''; - this.onlineRating = 0; - - this.released = false; - this.status = ''; - this.publishedFrom = ''; - this.publishedTo = ''; - - this.userData = { - read: false, - lastRead: '', - personalRating: 0, - }; - - migrateObject(this, obj, this); - - if (!obj.hasOwnProperty('userData')) { - migrateObject(this.userData, obj, this.userData); - } - - this.type = this.getMediaType(); - } - - getTags(): string[] { - return [mediaDbTag, 'comicbook']; - } - - getMediaType(): MediaType { - return MediaType.ComicBook; - } - - getSummary(): string { - return this.englishTitle + ' (' + this.year + ') - ' + this.publishers; - } -} diff --git a/src/models/MangaModel.ts b/src/models/MangaModel.ts deleted file mode 100644 index 55efae6..0000000 --- a/src/models/MangaModel.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { MediaType } from '../utils/MediaType'; -import type { ModelToData } from '../utils/Utils'; -import { mediaDbTag, migrateObject } from '../utils/Utils'; -import { MediaTypeModel } from './MediaTypeModel'; - -export type MangaData = ModelToData; - -export class MangaModel extends MediaTypeModel { - plot: string; - alternateTitles: string[]; - genres: string[]; - authors: string[]; - chapters: number; - volumes: number; - onlineRating: number; - image: string; - - released: boolean; - status: string; - publishers: string[]; - publishedFrom: string; - publishedTo: string; - - userData: { - watched: boolean; - lastWatched: string; - personalRating: number; - }; - - constructor(obj: MangaData) { - super(); - - this.plot = ''; - this.alternateTitles = []; - this.genres = []; - this.authors = []; - this.chapters = 0; - this.volumes = 0; - this.onlineRating = 0; - this.image = ''; - - this.released = false; - this.status = ''; - this.publishers = []; - this.publishedFrom = ''; - this.publishedTo = ''; - - this.userData = { - watched: false, - lastWatched: '', - personalRating: 0, - }; - - migrateObject(this, obj, this); - - if (!obj.hasOwnProperty('userData')) { - migrateObject(this.userData, obj, this.userData); - } - - this.type = this.getMediaType(); - } - - getTags(): string[] { - return [mediaDbTag, 'manga', 'light-novel']; - } - - getMediaType(): MediaType { - return MediaType.Manga; - } - - getSummary(): string { - return this.title + ' (' + this.year + ')'; - } -}