MusicBrainz: Add releaseDate to music releases

This commit is contained in:
Zack Boehm 2025-07-24 20:23:36 -04:00
parent c87cb098b2
commit 5089287ee4
2 changed files with 6 additions and 0 deletions

View file

@ -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,

View file

@ -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,
};