From 9d4d6eb0edd9d990a4a860e608ab0bedeaabd2b1 Mon Sep 17 00:00:00 2001 From: Max Riegler Date: Wed, 29 Nov 2023 08:00:20 +0100 Subject: [PATCH 1/2] adapt recommendations to include a full track object with a full album --- lib/src/models/recommendations.dart | 4 ++-- lib/src/models/track.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/models/recommendations.dart b/lib/src/models/recommendations.dart index 044d52b..feac4fd 100644 --- a/lib/src/models/recommendations.dart +++ b/lib/src/models/recommendations.dart @@ -11,9 +11,9 @@ class Recommendations extends Object { /// A List of [RecommendationsSeed] objects. List? seeds; - /// A List of [TrackSimple] objects ordered according to the parameters + /// A List of [Track] objects ordered according to the parameters /// supplied. - List? tracks; + List? tracks; } /// Json representation of the recommendation seed diff --git a/lib/src/models/track.dart b/lib/src/models/track.dart index a45e459..4e36902 100644 --- a/lib/src/models/track.dart +++ b/lib/src/models/track.dart @@ -12,7 +12,7 @@ class Track extends Object implements TrackSimple { /// The album on which the track appears. The album object includes a link /// in [href] to full information about the album. - AlbumSimple? album; + Album? album; /// The artists who performed the track. Each artist object includes a link /// in [href] to more detailed information about the artist. From 30e0c9386fe613014ab59ea8c745219aa50c45e3 Mon Sep 17 00:00:00 2001 From: Max Riegler Date: Wed, 29 Nov 2023 08:04:27 +0100 Subject: [PATCH 2/2] fix generated model --- lib/src/models/_models.g.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/models/_models.g.dart b/lib/src/models/_models.g.dart index f9858ca..1a09af1 100644 --- a/lib/src/models/_models.g.dart +++ b/lib/src/models/_models.g.dart @@ -685,7 +685,7 @@ Recommendations _$RecommendationsFromJson(Map json) => ?.map((e) => RecommendationsSeed.fromJson(e as Map)) .toList() ..tracks = (json['tracks'] as List?) - ?.map((e) => TrackSimple.fromJson(e as Map)) + ?.map((e) => Track.fromJson(e as Map)) .toList(); RecommendationsSeed _$RecommendationsSeedFromJson(Map json) => @@ -782,7 +782,7 @@ EpisodeFull _$EpisodeFullFromJson(Map json) => EpisodeFull() Track _$TrackFromJson(Map json) => Track() ..album = json['album'] == null ? null - : AlbumSimple.fromJson(json['album'] as Map) + : Album.fromJson(json['album'] as Map) ..artists = (json['artists'] as List?) ?.map((e) => Artist.fromJson(e as Map)) .toList()