private static IEnumerable<SpotifyArtist> GetArtistsForTrack(PlaylistTrack oPlaylistTrack) { List<SpotifyArtist> oArtists = new List<SpotifyArtist>(); foreach (SimpleArtist oSimpleArtist in oPlaylistTrack.Track.Artists) { if (oSimpleArtist.Id == null) {//Their web model causes this to be null sometimes and I have no idea why but my only course of action is to hash the name and use that as the spotifyID oSimpleArtist.Id = HashSlingingSlasher.HashString(oSimpleArtist.Name + oSimpleArtist.Type);//Using the name and the type should make it pretty darn unique I would think.... } oArtists.Add(new SpotifyArtist(oSimpleArtist)); } return oArtists; }
public SpotifyTrack(PlaylistTrack oPlaylistTrack, IEnumerable<SpotifyArtist> oArtists) : base(oPlaylistTrack.Track.Id, oPlaylistTrack.Track.Name) { this._Artists = oArtists; }