Merge pull request #198 from ZackBoe/mb-releasedate
MusicBrainz: Add releaseDate to music releases
This commit is contained in:
commit
aab9ee64c2
2 changed files with 6 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ import { APIModel } from '../APIModel';
|
|||
|
||||
export class MusicBrainzAPI extends APIModel {
|
||||
plugin: MediaDbPlugin;
|
||||
apiDateFormat: string = 'YYYY-MM-DD';
|
||||
|
||||
constructor(plugin: MediaDbPlugin) {
|
||||
super();
|
||||
|
|
@ -48,6 +49,7 @@ export class MusicBrainzAPI extends APIModel {
|
|||
title: result.title,
|
||||
englishTitle: result.title,
|
||||
year: new Date(result['first-release-date']).getFullYear().toString(),
|
||||
releaseDate: this.plugin.dateFormatter.format(result['first-release-date'], this.apiDateFormat) ?? 'unknown',
|
||||
dataSource: this.apiName,
|
||||
url: 'https://musicbrainz.org/release-group/' + result.id,
|
||||
id: result.id,
|
||||
|
|
@ -84,6 +86,7 @@ export class MusicBrainzAPI extends APIModel {
|
|||
title: result.title,
|
||||
englishTitle: result.title,
|
||||
year: new Date(result['first-release-date']).getFullYear().toString(),
|
||||
releaseDate: this.plugin.dateFormatter.format(result['first-release-date'], this.apiDateFormat) ?? 'unknown',
|
||||
dataSource: this.apiName,
|
||||
url: 'https://musicbrainz.org/release-group/' + result.id,
|
||||
id: result.id,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ export class MusicReleaseModel extends MediaTypeModel {
|
|||
artists: string[];
|
||||
image: string;
|
||||
rating: number;
|
||||
releaseDate: string;
|
||||
|
||||
userData: {
|
||||
personalRating: number;
|
||||
|
|
@ -22,6 +23,8 @@ export class MusicReleaseModel extends MediaTypeModel {
|
|||
this.artists = [];
|
||||
this.image = '';
|
||||
this.rating = 0;
|
||||
this.releaseDate = '';
|
||||
|
||||
this.userData = {
|
||||
personalRating: 0,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue