Exemple #1
0
        private void BuildData()
        {
            // find actors that have been in more than one thing
            lock (TheTVDB.LocalCache.Instance.SERIES_LOCK)
            {
                theData = new DataArr(mDoc.TvLibrary.Count);
                foreach (ShowConfiguration ser in mDoc.TvLibrary.Shows)
                {
                    CachedSeriesInfo?si = ser.CachedShow;
                    foreach (string aa in ser.Actors.Select(act => act.ActorName.Trim()).Where(aa => !string.IsNullOrEmpty(aa)))
                    {
                        theData.Set(ser.ShowName, aa, true);
                    }

                    if (cbGuestStars.Checked && si != null)
                    {
                        foreach (Episode ep in si.Episodes)
                        {
                            foreach (string g in ep.GuestStars)
                            {
                                theData.Set(ser.ShowName, g.Trim(), false);
                            }
                        }
                    }
                }
            }

            theData.RemoveEmpties();
        }
Exemple #2
0
        public ActorsGrid(TVDoc doc)
        {
            @internal = 0;

            InitializeComponent();

            mDoc           = doc;
            Cursor.Current = Cursors.WaitCursor;
            BuildData();
            DoSort();
            Cursor.Current = Cursors.Default;
            theData        = new DataArr(mDoc.TvLibrary.Count);
        }
Exemple #3
0
        private void BuildData()
        {
            // find actors that have been in more than one thing
            // Dictionary<String^, List<String> ^> ^whoInWhat = gcnew Dictionary<String^, List<String> ^>;
            TheTVDB db = this.mDoc.GetTVDB(true, "Actors");

            this.TheData = new DataArr(db.GetSeriesDict().Count);
            foreach (System.Collections.Generic.KeyValuePair <int, SeriesInfo> ser in db.GetSeriesDict())
            {
                SeriesInfo si     = ser.Value;
                string     actors = si.GetItem("Actors");
                if (!string.IsNullOrEmpty(actors))
                {
                    foreach (string act in actors.Split('|'))
                    {
                        string aa = act.Trim();
                        if (!string.IsNullOrEmpty(aa))
                        {
                            this.TheData.Set(si.Name, aa, true);
                        }
                    }
                }

                if (this.cbGuestStars.Checked)
                {
                    foreach (System.Collections.Generic.KeyValuePair <int, Season> kvp in si.Seasons)
                    {
                        foreach (Episode ep in kvp.Value.Episodes)
                        {
                            string guest = ep.GetItem("GuestStars");

                            if (!string.IsNullOrEmpty(guest))
                            {
                                foreach (string g in guest.Split('|'))
                                {
                                    string aa = g.Trim();
                                    if (!string.IsNullOrEmpty(aa))
                                    {
                                        this.TheData.Set(si.Name, aa, false);
                                    }
                                }
                            }
                        }
                    }
                }
            }

            db.Unlock("Actors");
            this.TheData.RemoveEmpties();
        }
Exemple #4
0
        private void BuildData()
        {
            // find actors that have been in more than one thing
            // Dictionary<String^, List<String> ^> ^whoInWhat = gcnew Dictionary<String^, List<String> ^>;
            TheTVDB.Instance.GetLock("Actors");
            this.TheData = new DataArr(TheTVDB.Instance.GetSeriesDict().Count);
            foreach (System.Collections.Generic.KeyValuePair<int, SeriesInfo> ser in TheTVDB.Instance.GetSeriesDict())
            {
                SeriesInfo si = ser.Value;
                string actors = si.GetItem("Actors");
                if (!string.IsNullOrEmpty(actors))
                {
                    foreach (string act in actors.Split('|'))
                    {
                        string aa = act.Trim();
                        if (!string.IsNullOrEmpty(aa))
                            this.TheData.Set(si.Name, aa, true);
                    }
                }

                if (this.cbGuestStars.Checked)
                {
                    foreach (System.Collections.Generic.KeyValuePair<int, Season> kvp in si.Seasons)
                    {
                        foreach (Episode ep in kvp.Value.Episodes)
                        {
                            string guest = ep.GetItem("GuestStars");

                            if (!string.IsNullOrEmpty(guest))
                            {
                                foreach (string g in guest.Split('|'))
                                {
                                    string aa = g.Trim();
                                    if (!string.IsNullOrEmpty(aa))
                                        this.TheData.Set(si.Name, aa, false);
                                }
                            }
                        }
                    }
                }
            }

            TheTVDB.Instance.Unlock("Actors");
            this.TheData.RemoveEmpties();
        }
Exemple #5
0
        private void BuildData()
        {
            // find actors that have been in more than one thing
            // Dictionary<String^, List<String> ^> ^whoInWhat = gcnew Dictionary<String^, List<String> ^>;
            TheTVDB.Instance.GetLock("Actors");
            theData = new DataArr(mDoc.Library.Count);
            foreach (ShowItem ser in mDoc.Library.Shows)
            {
                SeriesInfo si = TheTVDB.Instance.GetSeries(ser.TvdbCode);
                foreach (Actor act in si.GetActors())
                {
                    string aa = act.ActorName.Trim();
                    if (!string.IsNullOrEmpty(aa))
                    {
                        theData.Set(si.Name, aa, true);
                    }
                }

                if (cbGuestStars.Checked)
                {
                    foreach (KeyValuePair <int, Season> kvp in si.AiredSeasons) //We can use AiredSeasons as it does not matter which order we do this in Aired or DVD
                    {
                        foreach (Episode ep in kvp.Value.Episodes.Values)
                        {
                            foreach (string g in ep.GuestStars)
                            {
                                string aa = g.Trim();
                                if (!string.IsNullOrEmpty(aa))
                                {
                                    theData.Set(si.Name, aa, false);
                                }
                            }
                        }
                    }
                }
            }

            TheTVDB.Instance.Unlock("Actors");
            theData.RemoveEmpties();
        }
Exemple #6
0
        public void GetData(int page)
        {
            WebRequest   request  = WebRequest.Create(@"https://reqres.in/api/users?page=" + page);
            WebResponse  response = request.GetResponse();
            Stream       stream   = response.GetResponseStream();
            StreamReader reader   = new StreamReader(stream);

            string line = "";

            line = reader.ReadToEnd();

            response.Close();

            string json = line;

            DataArr ro = JsonConvert.DeserializeObject <DataArr>(json);

            foreach (var data in ro.data)
            {
                textBox1.Text += string.Format("{0} {1}", data.first_name, data.last_name) + Environment.NewLine + Environment.NewLine;
            }
        }
        private void BuildData()
        {
            // find actors that have been in more than one thing
            lock (TheTVDB.SERIES_LOCK)
            {
                theData = new DataArr(mDoc.Library.Count);
                foreach (ShowItem ser in mDoc.Library.Shows)
                {
                    SeriesInfo si = TheTVDB.Instance.GetSeries(ser.TvdbCode);
                    foreach (string aa in ser.Actors.Select(act => act.ActorName.Trim()).Where(aa => !string.IsNullOrEmpty(aa)))
                    {
                        theData.Set(si?.Name, aa, true);
                    }

                    if (cbGuestStars.Checked && si != null)
                    {
                        foreach (KeyValuePair <int, Season> kvp in si.AiredSeasons
                                 ) //We can use AiredSeasons as it does not matter which order we do this in Aired or DVD
                        {
                            foreach (Episode ep in kvp.Value.Episodes.Values)
                            {
                                foreach (string g in ep.GuestStars)
                                {
                                    string aa = g.Trim();
                                    if (!string.IsNullOrEmpty(aa))
                                    {
                                        theData.Set(si.Name, aa, false);
                                    }
                                }
                            }
                        }
                    }
                }
            }

            theData.RemoveEmpties();
        }