예제 #1
0
        private void OnProgress(object sender, ConversionProgressEventArgs e)
        {
            Convectors convectors = new Convectors();

            Dispatcher.BeginInvoke(new ThreadStart(delegate { SizeDownload.Content = convectors.ConvertSize(Convert.ToDouble(e.SizeKb * 1024)); }));
            Dispatcher.BeginInvoke(new ThreadStart(delegate { TimeDownload.Content = e.ProcessedDuration; }));
        }
예제 #2
0
        public void ChangeAnime_JObject(JObject jsonAnime)
        {
            NameTitle           = jsonAnime["names"]["ru"].ToString();
            NameTitleEN         = jsonAnime["names"]["en"].ToString();
            GroupTitleName.Text = NameTitle;
            String Content = "Статус: " + jsonAnime["status"]["string"] + "\n";

            Content      += "Серий: " + jsonAnime["type"]["full_string"] + "\n";
            Content      += jsonAnime["description"] + "\n";
            Opicanie.Text = Content.ToString();
            Series.Items.Clear();
            QualityComboBox.Items.Clear();
            if (jsonAnime["player"]["playlist"]["1"]["hls"]["sd"].ToString() != "")
            {
                QualityComboBox.Items.Add("SD");
            }
            if (jsonAnime["player"]["playlist"]["1"]["hls"]["hd"].ToString() != "")
            {
                QualityComboBox.Items.Add("HD");
            }
            if (jsonAnime["player"]["playlist"]["1"]["hls"]["fhd"].ToString() != "")
            {
                QualityComboBox.Items.Add("FHD");
            }
            if (torrent != null)
            {
                torrent.Clear();
            }
            for (int i = 1; i <= (int)jsonAnime["type"]["series"]; i++)
            {
                Series.Items.Add(i);
            }

            Convectors convectors = new Convectors();

            ChangeImage(jsonAnime["poster"]["url"].ToString());
            Series.SelectedIndex          = 0;
            QualityComboBox.SelectedIndex = 0;
            torrent = new ObservableCollection <Torrent>();
            foreach (var Item in jsonAnime["torrents"]["list"])
            {
                torrent.Add(new Torrent
                {
                    ID      = (int)Item["torrent_id"],
                    Name    = NameTitleEN + " " + Item["quality"]["string"].ToString(),
                    Series  = Item["series"]["string"].ToString(),
                    Quality = Item["quality"]["string"].ToString(),
                    Size    = convectors.ConvertSize((double)Item["total_size"]),
                });
            }

            TorrentsItem.ItemsSource = torrent;
        }