Пример #1
0
        public static SpotifyTrack FromJsonFactory(JObject json)
        {
            SpotifyTrack t = new SpotifyTrack
            {
                Title = (string) json["name"],
                AlbumTitle = (string)json["album"]["name"],
                Artist = (string) json["artists"].First()["name"],
                Duration = (int) json["length"],
                Identifier = (string) json["href"],
                IsExplicit = json["explicit"] != null
            };

            return t;
        }
Пример #2
0
        public SongMatch(ZuneTrack original, List<SpotifyTrack> candidates)
        {
            OriginalTrack = original;
            Candidates = candidates;

            if (candidates.Count > 0)
            {
                MatchedTrack = candidates[0];
            }
        }
Пример #3
0
 public void Setup()
 {
     JObject data = JObject.Parse(SampleTrackJson);
     _testTrack = SpotifyTrack.FromJsonFactory(data);
 }