Beispiel #1
0
        public static async void ReadyToExtract(Serie _serie, Range _range = null)
        {
            AnimePaheExtractorWPF.Extract.CurrentSerie = _serie;

            DefExtract = new Extract();
            _mainWindow.ExtractTabItem.Content = DefExtract;

            _mainWindow.MainMenuTabControl.SelectedIndex = 2;

            // Bring puppeteer to life, from the nothing it's become
            AnimepaheExtractor.InitializePuppeteer();

            IList <Episode> _episodes = await AnimepaheExtractor.GetEpisodesList(Extract.CurrentSerie.Id, _range);

            foreach (Episode _episode in _episodes)
            {
                bool _gathered = await _episode.GatherEpisodeLinksData(Extract.CurrentSerie.Id);

                if (_gathered)
                {
                    ExtractGridItem _item = new ExtractGridItem()
                    {
                        EpisodeNumber = _episode.EpisodeNumber,
                        Quality       = _episode.EpisodeLinksData[0].Quality,
                        FanSub        = _episode.EpisodeLinksData[0].FanSub,
                        Progress      = 0,
                        StatusEnum    = ExtractionStatus.Queued,

                        Episode = _episode
                    };

                    DefExtract.ExtractsGrid.DataContext = _item;

                    DefExtract.ExtractsGrid.Items.Add(_item);

                    DefExtract.ExtractsGrid_AddItem(_item);
                }
            }

            // After gathering all episodes, extract could start
            DefExtract.AllEpisodesReadyToExtract = true;
        }