File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { APIModel } from '../APIModel';
88
99export class MusicBrainzAPI extends APIModel {
1010 plugin : MediaDbPlugin ;
11+ apiDateFormat : string = 'YYYY-MM-DD' ;
1112
1213 constructor ( plugin : MediaDbPlugin ) {
1314 super ( ) ;
@@ -48,6 +49,7 @@ export class MusicBrainzAPI extends APIModel {
4849 title : result . title ,
4950 englishTitle : result . title ,
5051 year : new Date ( result [ 'first-release-date' ] ) . getFullYear ( ) . toString ( ) ,
52+ releaseDate : this . plugin . dateFormatter . format ( result [ 'first-release-date' ] , this . apiDateFormat ) ?? 'unknown' ,
5153 dataSource : this . apiName ,
5254 url : 'https://musicbrainz.org/release-group/' + result . id ,
5355 id : result . id ,
@@ -84,6 +86,7 @@ export class MusicBrainzAPI extends APIModel {
8486 title : result . title ,
8587 englishTitle : result . title ,
8688 year : new Date ( result [ 'first-release-date' ] ) . getFullYear ( ) . toString ( ) ,
89+ releaseDate : this . plugin . dateFormatter . format ( result [ 'first-release-date' ] , this . apiDateFormat ) ?? 'unknown' ,
8790 dataSource : this . apiName ,
8891 url : 'https://musicbrainz.org/release-group/' + result . id ,
8992 id : result . id ,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export class MusicReleaseModel extends MediaTypeModel {
1010 artists : string [ ] ;
1111 image : string ;
1212 rating : number ;
13+ releaseDate : string ;
1314
1415 userData : {
1516 personalRating : number ;
@@ -22,6 +23,8 @@ export class MusicReleaseModel extends MediaTypeModel {
2223 this . artists = [ ] ;
2324 this . image = '' ;
2425 this . rating = 0 ;
26+ this . releaseDate = '' ;
27+
2528 this . userData = {
2629 personalRating : 0 ,
2730 } ;
You can’t perform that action at this time.
0 commit comments