public SCTrack Convert(Track track)
        {
            if (track == null)
            {
                return(null);
            }

            return(new SCTrack
            {
                Id = track.Id,
                CreatedAt = dateTimeConverter.Convert(track.CreatedAt),
                UserId = track.UserId,
                User = userConverter.Convert(track.User),
                Title = track.Title,
                Permalink = track.Permalink,
                PermalinkUrl = track.PermalinkUrl,
                Uri = track.Uri,
                Sharing = track.Sharing.GetValue <SCSharing>(),
                EmbeddableBy = track.EmbeddableBy.GetValue <SCEmbeddableBy>(),
                Artwork = SCScalableEntity <SCArtworkFormat> .Create(track.Artwork),
                Description = track.Description,
                Label = userConverter.Convert(track.Label),
                Duration = TimeSpan.FromMilliseconds(track.Duration),
                Genre = track.Genre,
                TagList = tagListConverter.Convert(track.TagList),
                LabelId = track.LabelId,
                LabelName = track.LabelName,
                ReleaseNumber = track.Release,
                ReleaseDate = dateTimeConverter.ConvertReleaseDate(track.ReleaseYear, track.ReleaseMonth, track.ReleaseDay),
                Streamable = track.Streamable,
                Downloadable = track.Downloadable,
                State = track.State.GetValue <SCState>(),
                License = track.License.GetValue <SCLicense>(),
                TrackType = track.TrackType.GetValue <SCTrackType>(),
                WaveformUrl = track.WaveformUrl,
                DownloadUrl = track.DownloadUrl,
                StreamUrl = track.StreamUrl,
                VideoUrl = track.VideoUrl,
                Bpm = track.Bpm,
                Commentable = track.Commentable,
                Isrc = track.Isrc,
                KeySignature = track.KeySignature,
                CommentsCount = track.CommentsCount,
                DownloadCount = track.DownloadCount,
                PlaybackCount = track.PlaybackCount,
                FavoritingsCount = track.FavoritingsCount,
                OriginalFormat = track.OriginalFormat,
                OriginalContentSize = track.OriginalContentSize,
                CreatedWith = applicationConverter.Convert(track.CreatedWith),
                UserFavorite = track.UserFavorite,
                AttachmentUri = track.AttachmentUri,
                DownloadsRemaining = track.DownloadsRemaining,
                PurchaseUrl = track.PurchaseUrl,
                SecretToken = track.SecretToken,
                SecretUri = track.SecretUri,
                UserPlaybackCount = track.UserPlaybackCount
            });
        }
Esempio n. 2
0
        public SCApplication GetApplication()
        {
            var application = soundCloudRawClient.Request <Application>(prefix, string.Empty, HttpMethod.Get);

            return(applicationConverter.Convert(application));
        }