@@ -7,21 +7,21 @@ export const createSongPayload = (song: z.infer<typeof SongAPIResponseModel>): z
7
7
id : song . id ,
8
8
name : song . title ,
9
9
type : song . type ,
10
- year : Number ( song . year || 0 ) ,
11
- releaseDate : song . more_info ?. release_date ,
12
- duration : Number ( song . more_info ?. duration ) ,
13
- label : song . more_info ?. label ,
10
+ year : song ? .year || null ,
11
+ releaseDate : song . more_info ?. release_date || null ,
12
+ duration : song . more_info ?. duration ? Number ( song . more_info ?. duration ) : null ,
13
+ label : song . more_info ?. label || null ,
14
14
explicitContent : song . explicit_content === '1' ,
15
15
playCount : Number ( song . play_count || 0 ) ,
16
16
language : song . language ,
17
17
hasLyrics : song . more_info ?. has_lyrics === 'true' ,
18
18
lyricsId : song . more_info ?. lyrics_id || null ,
19
19
url : song . perma_url ,
20
- copyright : song . more_info ?. copyright_text ,
20
+ copyright : song . more_info ?. copyright_text || null ,
21
21
album : {
22
- id : song . more_info ?. album_id ,
23
- name : song . more_info ?. album ,
24
- url : song . more_info ?. album_url
22
+ id : song . more_info ?. album_id || null ,
23
+ name : song . more_info ?. album || null ,
24
+ url : song . more_info ?. album_url || null
25
25
} ,
26
26
artists : {
27
27
primary : song . more_info ?. artistMap ?. primary_artists ?. map ( createArtistMapPayload ) ,
0 commit comments