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';
8
8
9
9
export class MusicBrainzAPI extends APIModel {
10
10
plugin : MediaDbPlugin ;
11
+ apiDateFormat : string = 'YYYY-MM-DD' ;
11
12
12
13
constructor ( plugin : MediaDbPlugin ) {
13
14
super ( ) ;
@@ -48,6 +49,7 @@ export class MusicBrainzAPI extends APIModel {
48
49
title : result . title ,
49
50
englishTitle : result . title ,
50
51
year : new Date ( result [ 'first-release-date' ] ) . getFullYear ( ) . toString ( ) ,
52
+ releaseDate : this . plugin . dateFormatter . format ( result [ 'first-release-date' ] , this . apiDateFormat ) ?? 'unknown' ,
51
53
dataSource : this . apiName ,
52
54
url : 'https://musicbrainz.org/release-group/' + result . id ,
53
55
id : result . id ,
@@ -84,6 +86,7 @@ export class MusicBrainzAPI extends APIModel {
84
86
title : result . title ,
85
87
englishTitle : result . title ,
86
88
year : new Date ( result [ 'first-release-date' ] ) . getFullYear ( ) . toString ( ) ,
89
+ releaseDate : this . plugin . dateFormatter . format ( result [ 'first-release-date' ] , this . apiDateFormat ) ?? 'unknown' ,
87
90
dataSource : this . apiName ,
88
91
url : 'https://musicbrainz.org/release-group/' + result . id ,
89
92
id : result . id ,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export class MusicReleaseModel extends MediaTypeModel {
10
10
artists : string [ ] ;
11
11
image : string ;
12
12
rating : number ;
13
+ releaseDate : string ;
13
14
14
15
userData : {
15
16
personalRating : number ;
@@ -22,6 +23,8 @@ export class MusicReleaseModel extends MediaTypeModel {
22
23
this . artists = [ ] ;
23
24
this . image = '' ;
24
25
this . rating = 0 ;
26
+ this . releaseDate = '' ;
27
+
25
28
this . userData = {
26
29
personalRating : 0 ,
27
30
} ;
You can’t perform that action at this time.
0 commit comments