Пример #1
0
        public async void DownloadButtonClick()
        {
            List <Playlist> playlistsToBeDownloaded = new List <Playlist>();

            foreach (PlaylistViewModel playVM in playlistsSelected)
            {
                if (playVM.PlaylistModel.clips.Count == 0)
                {
                    ClipResponse response = await ServiceAccessor.GetPlaylistClipsAndHeaders(playVM.PlaylistModel.playlistId);

                    playVM.PlaylistModel.clips          = response.clips;
                    playVM.PlaylistModel.displayColumns = response.DisplayColumns;
                }
                List <Clip> additionalClips = await ServiceAccessor.GetAdditionalPlaylistClips(playVM.PlaylistModel.playlistId, playVM.PlaylistModel.clips.Count);

                foreach (Clip c in additionalClips)
                {
                    playVM.PlaylistModel.clips.Add(c);
                }
                playlistsToBeDownloaded.Add(playVM.PlaylistModel);
            }
            DownloadButton_Visibility     = Visibility.Collapsed;
            Downloading_Visibility        = Visibility.Visible;
            DownloadProgressText          = "Preparing Download";
            DownloadProgress              = 0;
            DownloadAccessor.Instance.cts = new CancellationTokenSource();
            DownloadAccessor.Instance.currentlyDownloadingPlaylists = playlistsToBeDownloaded;
            DownloadAccessor.Instance.progressCallback = new Progress <DownloadOperation>(ProgressCallback);
            DownloadAccessor.Instance.DownloadPlaylists(playlistsToBeDownloaded, Season.DeepCopy(Parameter.season));
        }
Пример #2
0
        private async void getMoreClips()
        {
            List <Clip> remainingClipsList = await ServiceAccessor.GetAdditionalPlaylistClips(Parameter.playlist.playlistId, 100);

            foreach (Clip clip in remainingClipsList)
            {
                foreach (Angle angle in clip.angles)
                {
                    angle.angleType = AngleTypes.FirstOrDefault(angleType => angleType.Name.Equals(angle.angleName));
                }
            }
            foreach (Clip c in remainingClipsList)
            {
                Clips.Add(c);
                if (!FiltersList.Any())
                {
                    FilteredClips.Add(c);
                }
            }
        }