using System.Collections.Generic; using Sony.Filtr.Contracts.Definitions; using Sony.Filtr.Contracts.Entities; namespace Sony.Filtr.Search.SearchItems { public class ReleaseSearchIndexItem { public ReleaseSearchIndexItem() { } public ReleaseSearchIndexItem(DeezerRelease release) { if (release.ReleaseType == ReleaseType.Album) { Name = release.AlbumName; DeezerId = release.AlbumID; } else { Name = release.TrackName; DeezerId = release.TrackId; } ApplicationId = release.ApplicationID; ImageUrl = release.ImageFilename; TypeName = typeof(ReleaseSearchIndexItem).Name; ServiceType = ServiceType.Deezer; TrackLink = release.TrackId; Id = release.ID; //Tags = new List(); //TODO: } public ReleaseSearchIndexItem(Release release) { Id = release.ID; Name = release.AlbumName; SpotifyUri = release.SpotifyLinkUri; ApplicationId = release.ApplicationID; ImageUrl = release.ImageFilename; TypeName = typeof (ReleaseSearchIndexItem).Name; ServiceType = ServiceType.Spotify; Artists = new List() { release.ArtistName }; TrackLink = release.TrackLink.Uri; AlbumLink = release.AlbumLink.Uri; ArtistLink = release.ArtistUri; TrackName = release.TrackName; ArtistName = release.ArtistName; AlbumName = release.AlbumName; ReleaseType = release.ReleaseType; Energy = release.Energy; Hotness = release.Hotness; Danceability = release.Danceability; Tempo = release.Tempo; //Tags = new List(); //TODO: } public int Id { get; set; } public string Name { get; set; } public string SpotifyUri { get; set; } public string DeezerId { get; set; } public string TypeName { get; set; } public int ApplicationId { get; set; } public string ImageUrl { get; set; } public List Tags { get; set; } public List Artists { get; set; } public List Tracks { get; set; } public string TrackLink { get; set; } public string ArtistLink { get; set; } public string AlbumLink { get; set; } public string TrackName { get; set; } public string ArtistName { get; set; } public string AlbumName { get; set; } public ReleaseType ReleaseType { get; set; } public double? Energy { get; set; } public double? Hotness { get; set; } public double? Danceability { get; set; } public double? Tempo { get; set; } public ServiceType ServiceType { get; set; } } }