Exemplo n.º 1
0
        public List <SpotifyTrack> GetSpotifyTracks(string query)
        {
            List <FullTrack>    FullTrackList = SpotifyApi.SearchTracksByQuery(query, _spotifyAuth);
            List <SpotifyTrack> TrackList     = new List <SpotifyTrack>();

            foreach (FullTrack track in FullTrackList)
            {
                SpotifyTrack NewTrack = new SpotifyTrack
                {
                    Name      = track.Name,
                    SpotifyID = track.Id
                };
                TrackList.Add(NewTrack);
            }
            return(TrackList);
        }
Exemplo n.º 2
0
        public List <SpotifyTrack> GetSpotifyTracks(SpotifyAlbum albumObj)
        {
            List <SimpleTrack>  SimpleTrackList = SpotifyApi.SearchTracks(albumObj, _spotifyAuth);
            List <SpotifyTrack> TrackList       = new List <SpotifyTrack>();

            foreach (SimpleTrack track in SimpleTrackList)
            {
                SpotifyTrack NewTrack = new SpotifyTrack
                {
                    Name      = track.Name,
                    SpotifyID = track.Id,
                    TrackNo   = track.TrackNumber
                };
                TrackList.Add(NewTrack);
            }
            return(TrackList);
        }