Added language and trackCount fields for music
The language at musicbrainz is in the format of iso-639-2 so I use a package to translate it to a full name of the language.
This commit is contained in:
parent
b6f8258484
commit
f51a1465b4
5 changed files with 16 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { MediaType } from '../utils/MediaType';
|
||||
import type { ModelToData } from '../utils/Utils';
|
||||
import { mediaDbTag, migrateObject } from '../utils/Utils';
|
||||
import { mediaDbTag, migrateObject, getLanguageName } from '../utils/Utils';
|
||||
import { MediaTypeModel } from './MediaTypeModel';
|
||||
|
||||
export type MusicReleaseData = ModelToData<MusicReleaseModel>;
|
||||
|
|
@ -8,9 +8,11 @@ export type MusicReleaseData = ModelToData<MusicReleaseModel>;
|
|||
export class MusicReleaseModel extends MediaTypeModel {
|
||||
genres: string[];
|
||||
artists: string[];
|
||||
language: string;
|
||||
image: string;
|
||||
rating: number;
|
||||
releaseDate: string;
|
||||
trackCount: number;
|
||||
tracks: {
|
||||
number: number;
|
||||
title: string;
|
||||
|
|
@ -42,7 +44,9 @@ export class MusicReleaseModel extends MediaTypeModel {
|
|||
}
|
||||
|
||||
this.type = this.getMediaType();
|
||||
this.trackCount = obj.trackCount ?? 0;
|
||||
this.tracks = obj.tracks ?? [];
|
||||
this.language = obj.language ?? '';
|
||||
}
|
||||
|
||||
getTags(): string[] {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue