Пример #1
0
        public async Task <Dictionary <ExtendedPlayList, List <ExtendedTrack> > > GetPlayLists()
        {
            var playlists = await _client.Me.GetPlaylistsAsync();

            List <ExtendedTrack> tracksOfPlayList;
            ExtendedPlayList     extendedPlayList;

            var playlistAndTracks = new Dictionary <ExtendedPlayList, List <ExtendedTrack> >();

            foreach (var playlist in playlists)
            {
                tracksOfPlayList = new List <ExtendedTrack>();
                extendedPlayList = new ExtendedPlayList
                {
                    PlayListTitle     = playlist.Title,
                    PlayListCreatedAt = playlist.CreatedAt
                };


                foreach (var track in playlist.Tracks)
                {
                    tracksOfPlayList.Add(new ExtendedTrack {
                        Title = track.Title, CreatedAt = track.CreatedAt, Likes = track.LikesCount
                    });
                }

                playlistAndTracks.Add(extendedPlayList, tracksOfPlayList);
            }


            return(playlistAndTracks);
        }
Пример #2
0
 public MainViewModel(ISoundCloudClient client)
 {
     playList             = new ExtendedPlayList();
     track                = new ExtendedTrack();
     _userPlayListService = new UserPlayListService(client);
     ExtendedTracks       = new ObservableCollection <ExtendedTrack>();
     PlayLists            = new ObservableCollection <ExtendedPlayList>();
 }