Example #1
0
        private async Task Init()
        {
            var returned = await _albumListService.Get <List <AlbumList> >(new AlbumListSearchRequest()
            {
                UserId = APIService.loggedProfile.UserId
            });

            returned.Remove(returned.Where(a => a.AlbumListName == "Liked Albums").FirstOrDefault());
            foreach (var item in returned)
            {
                var tracks = await _albumListAlbumService.Get <List <AlbumListAlbum> >(new AlbumListAlbumSearchRequest()
                {
                    AlbumListId = item.AlbumListId
                });

                if (tracks.Where(a => a.AlbumId == ThisAlbumId).FirstOrDefault() == null)
                {
                    AllAlbumLists.Add(item);
                    AlbumLists.Add(item);
                }
            }
        }
        private async Task LoadAlbumLists()
        {
            var albumListsReturned = await _albumListService.Get <List <Model.AlbumList> >(new AlbumListSearchRequest()
            {
                AlbumListType = "Public"
            });

            var albumListAlbumReturned = await _albumListAlbumService.Get <List <Model.AlbumListAlbum> >(null);

            foreach (var item in albumListsReturned)
            {
                AlbumListHelperVM local = new AlbumListHelperVM()
                {
                    AlbumListId     = item.AlbumListId,
                    AlbumListName   = item.AlbumListName,
                    ListDateCreated = item.ListDateCreated,
                    UserId          = item.UserId
                };
                local.Username       = "******" + AllUsers.Where(a => a.UserId == local.UserId).Select(a => a.Username).FirstOrDefault();
                local.NumberOfAlbums = "Number of albums: " + albumListAlbumReturned.Where(a => a.AlbumListId == local.AlbumListId).Count().ToString();
                AllAlbumLists.Add(local);
                QueryAlbumLists.Add(local);
            }
        }