Represents a Track delivered from Last.fm
Inheritance: EntityBase
Ejemplo n.º 1
0
        public LoadLastFmListDataResult<Track> SimilarTracks(Track track)
        {
            const int limit = 16;
            string s;
            var p1 = new Parameter
            {
                Name = LastFmDataAccess.ParamMethod,
                Value = LastFmDataAccess.MethodTrackGetSimilar
            };

            var p2 = new Parameter
            {
                Name = LastFmDataAccess.ParamAutocorrect,
                Value = true.ToString()
            };
            var p3 = new Parameter
            {
                Name = LastFmDataAccess.ParamLimit,
                Value = limit.ToString()
            };

            if (string.IsNullOrEmpty(track.MusicBrainzId))
            {
                var p4 = new Parameter
                {
                    Name = LastFmDataAccess.ParamArtist,
                    Value = track.ArtistName
                };

                var p5 = new Parameter
                {
                    Name = LastFmDataAccess.ParamTrack,
                    Value = track.Name
                };
                s = SearchStringBuilder(new[] { p1, p2, p3, p4, p5 });
            }
            else
            {
                var p4 = new Parameter
                {
                    Name = LastFmDataAccess.ParamMBID,
                    Value = track.MusicBrainzId
                };
                s = SearchStringBuilder(new[] { p1, p2, p3, p4 });
            }

            return new LoadLastFmListDataResult<Track>(s, "track");
        }
Ejemplo n.º 2
0
 public LoadLastFmEntityDataResult<Track> SingleTrack(Track track)
 {
     return SingleTrack(track.Name, track.ArtistName, track.MusicBrainzId);
 }