Пример #1
0
        public static async Task <IEnumerable <VKAudio> > GetFriendPlayList()
        {
            long friendId = MainViewModel.Instance.FriendsFilter.SelectedItem != null
                ? MainViewModel.Instance.FriendsFilter.SelectedItem.Item.Id
                : VKSession.Instance.UserId;

            CheckCurrentCTS();
            VKList <VKAudio> list = await AudioAPI.GetAsync((long)friendId, token : _currentCts.Token);

            return(list.Items);
        }
Пример #2
0
        public static async Task <IEnumerable <VKAudio> > GetGroupPlayList()
        {
            VKGroup group = MainViewModel.Instance.GroupsFilter.SelectedItem.Item;

            if (group == null)
            {
                return(null);
            }

            if (group.Type == VKGroup.TypeEnum.Page)
            {
                CheckCurrentCTS();

                try
                {
                    return(await GetAllAudioFromPost(-(long)group.Id, _currentCts.Token));
                }
                catch (OperationCanceledException)
                {
                }
            }
            if (group.Type == VKGroup.TypeEnum.Group)
            {
                CheckCurrentCTS();

                try
                {
                    VKList <VKAudio> list = (await AudioAPI.GetAsync(-(long)group.Id, token: _currentCts.Token));
                    return(list.Items);
                }
                catch (OperationCanceledException)
                {
                }
            }

            return(null);
        }