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 {
|
export class MusicBrainzAPI extends APIModel {
|
||||||
plugin: MediaDbPlugin;
|
plugin: MediaDbPlugin;
|
||||||
|
apiDateFormat: string = 'YYYY-MM-DD';
|
||||||
|
|
||||||
constructor(plugin: MediaDbPlugin) {
|
constructor(plugin: MediaDbPlugin) {
|
||||||
super();
|
super();
|
||||||
|
|
@ -48,6 +49,7 @@ export class MusicBrainzAPI extends APIModel {
|
||||||
title: result.title,
|
title: result.title,
|
||||||
englishTitle: result.title,
|
englishTitle: result.title,
|
||||||
year: new Date(result['first-release-date']).getFullYear().toString(),
|
year: new Date(result['first-release-date']).getFullYear().toString(),
|
||||||
|
releaseDate: this.plugin.dateFormatter.format(result['first-release-date'], this.apiDateFormat) ?? 'unknown',
|
||||||
dataSource: this.apiName,
|
dataSource: this.apiName,
|
||||||
url: 'https://musicbrainz.org/release-group/' + result.id,
|
url: 'https://musicbrainz.org/release-group/' + result.id,
|
||||||
id: result.id,
|
id: result.id,
|
||||||
|
|
@ -84,6 +86,7 @@ export class MusicBrainzAPI extends APIModel {
|
||||||
title: result.title,
|
title: result.title,
|
||||||
englishTitle: result.title,
|
englishTitle: result.title,
|
||||||
year: new Date(result['first-release-date']).getFullYear().toString(),
|
year: new Date(result['first-release-date']).getFullYear().toString(),
|
||||||
|
releaseDate: this.plugin.dateFormatter.format(result['first-release-date'], this.apiDateFormat) ?? 'unknown',
|
||||||
dataSource: this.apiName,
|
dataSource: this.apiName,
|
||||||
url: 'https://musicbrainz.org/release-group/' + result.id,
|
url: 'https://musicbrainz.org/release-group/' + result.id,
|
||||||
id: result.id,
|
id: result.id,
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ export class MusicReleaseModel extends MediaTypeModel {
|
||||||
artists: string[];
|
artists: string[];
|
||||||
image: string;
|
image: string;
|
||||||
rating: number;
|
rating: number;
|
||||||
|
releaseDate: string;
|
||||||
|
|
||||||
userData: {
|
userData: {
|
||||||
personalRating: number;
|
personalRating: number;
|
||||||
|
|
@ -22,6 +23,8 @@ export class MusicReleaseModel extends MediaTypeModel {
|
||||||
this.artists = [];
|
this.artists = [];
|
||||||
this.image = '';
|
this.image = '';
|
||||||
this.rating = 0;
|
this.rating = 0;
|
||||||
|
this.releaseDate = '';
|
||||||
|
|
||||||
this.userData = {
|
this.userData = {
|
||||||
personalRating: 0,
|
personalRating: 0,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue