Пример #1
0
        //Wyszukuje banery i dodaje je odrazu do _BannerList
        public void SearchForAllBanners(int _seriesID, SeriesDescriptionViewModel main)
        {
            string JSON = getReply("https://api.thetvdb.com/series/" + _seriesID + "/images/query?keyType=series");

            if (JSON != null)
            {
                JObject        tvdbSearch = JObject.Parse(JSON);
                IList <JToken> results    = tvdbSearch["data"].Children().ToList();

                foreach (JToken result in results)
                {
                    Poster p = result.ToObject <Poster>();

                    byte[] array;
                    using (WebClient client = new WebClient())
                    {
                        array = client.DownloadData(new Uri("http://thetvdb.com/banners/" + p.fileName));
                    }

                    Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(() =>
                                                                                                    main.BannerList.Add(array)));
                    Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(() =>
                                                                                                    main.UpdateBannerList()));
                }
            }
        }
Пример #2
0
 public ChangeBanner(SeriesDescriptionViewModel main)
 {
     if (main == null)
     {
         throw new ArgumentNullException("TrackedViewModel command");
     }
     this.main = main;
 }
Пример #3
0
 public AllAboveWatched(SeriesDescriptionViewModel main)
 {
     if (main == null)
     {
         throw new ArgumentNullException("TrackedViewModel command");
     }
     this.main = main;
 }