private void button2_Click_1(object sender, EventArgs e)
        {
            OnlineShowInfo newTMDbID = TMDbClient.findTitle(showNameTextBox.Text, true);

            if (newTMDbID.ShowID != -1)
            {
                TMDbTextBox.Text   = newTMDbID.ShowName;
                TMDbIDTextBox.Text = newTMDbID.ShowID.ToString();
                checkBox2.Checked  = newTMDbID.ShowEnded;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            int index = listBoxTVShowList.SelectedIndex;

            if (index == -1)
            {
                return;
            }

            OnlineShowInfo newTVDBID = TVDB.findTitle(showNameTextBox.Text, true);

            if (newTVDBID.ShowID != -1)
            {
                TVDBNameTextBox.Text = newTVDBID.ShowName;
                TVDBIDTextBox.Text   = newTVDBID.ShowID.ToString();
                checkBox2.Checked    = newTVDBID.ShowEnded;
            }
        }
        private void buttonAddShow_Click(object sender, EventArgs e)
        {
            string tvShowName = string.Empty;

            if (InputBox.Show("Edit Episode Title", "Episode Title:", ref tvShowName) == DialogResult.OK)
            {
                string[] subdirectoryEntries = Directory.GetDirectories(_RootDir);
                new List <string>(subdirectoryEntries);

                SelectMenu SelectMain = new SelectMenu(new List <string>(subdirectoryEntries), showNameTextBox.Text, "Select TV Show Folder");
                if (SelectMain.ShowDialog() == DialogResult.OK)
                {
                    int selectedid = SelectMain.selected;
                    if (selectedid == -1)
                    {
                        return;
                    }
                    string tvShowFolder = subdirectoryEntries[selectedid].Replace(_RootDir, "").Replace(Path.DirectorySeparatorChar.ToString(), "");
                    SelectMain.Close();
                    TVShowSettings newTvShow = new TVShowSettings(tvShowName, tvShowFolder);
                    OnlineShowInfo newTVDBID = TVDB.findTitle(tvShowName, true);
                    if (newTVDBID.ShowID != -1)
                    {
                        newTvShow.TVDBShowName = newTVDBID.ShowName;
                        newTvShow.TVDBSeriesID = newTVDBID.ShowID;
                        newTvShow.SeriesEnded  = newTVDBID.ShowEnded;
                    }

                    OnlineShowInfo newTMDbID = TMDbClient.findTitle(tvShowName, true);
                    if (newTMDbID.ShowID != -1)
                    {
                        newTvShow.TMDbShowName = newTMDbID.ShowName;
                        newTvShow.TMDbSeriesID = newTMDbID.ShowID;
                        newTvShow.SeriesEnded  = newTMDbID.ShowEnded;
                    }
                    _MainTVShowList.Add(newTvShow);
                }
            }
        }
示例#4
0
        private TVShowSettings getTVShowSettings(TVShowSettings newShow)
        {
            //TVShowSettings newShow = new TVShowSettings(showFolderName, showFolderName);

            OnlineShowInfo newTVDBID = theXEM.findTitle(newShow.SearchName);

            if (newTVDBID.ShowID != -1)
            {
                newShow.TVDBSeriesID = newTVDBID.ShowID;
                newShow.TVDBShowName = newTVDBID.ShowName;
                newShow.SeriesEnded  = newTVDBID.ShowEnded;
            }
            OnlineShowInfo newTMDbID = TMDbClient.findTitle(newShow.SearchName);

            if (newTMDbID.ShowID != -1)
            {
                newShow.TMDbSeriesID = newTMDbID.ShowID;
                newShow.TMDbShowName = newTMDbID.ShowName;

                newShow.SeriesEnded = newTVDBID.ShowEnded;
            }

            return(newShow);
        }
示例#5
0
        public static OnlineShowInfo findTitle(string ShowName, bool showAll = false)
        {
            List <OnlineShowInfo> selectionList = new List <OnlineShowInfo>();



            OnlineShowInfo TVShowID = new OnlineShowInfo();

            if (ShowName == null)
            {
                return(TVShowID);
            }
            //ShowName = ShowName.Replace("Gold Rush Alaska", "Gold Rush");
            //ShowName = ShowName.Replace("Tosh 0", "Tosh.0");
            List <OnlineShowInfo> FinalList = new List <OnlineShowInfo>();

            try
            {
                XDocument ShowList = XDocument.Load("http://services.tvrage.com/feeds/search.php?show=" + ShowName);

                var Categorys = from Show in ShowList.Descendants("show")
                                select new
                {
                    ShowID      = Show.Element("showid").Value,
                    Name        = Show.Element("name").Value,
                    YearStarted = Show.Element("started").Value,
                    Status      = Show.Element("status").Value
                };



                foreach (var wd in Categorys)
                {
                    FinalList.Add(new OnlineShowInfo(wd.Name, Int32.Parse(wd.ShowID), wd.YearStarted, wd.Status));
                }
            }
            catch (Exception e) { }

            if (FinalList != null && FinalList.Count > 0)
            {
                if (FinalList.Count() == 0)
                {
                    return(TVShowID);                                         //return if nothing found
                }
                OnlineShowInfo selectedShow = new OnlineShowInfo();
                if (FinalList.Count() == 1)
                {
                    selectedShow = FinalList[0];
                }
                else
                {
                    if (FinalList.Count() != 0)
                    {
                        int indexofTVshow = -1;
                        int difference    = Math.Abs(FinalList[0].ShowName.Length - ShowName.Length);
                        indexofTVshow = FinalList[0].ShowName.IndexOf(ShowName, StringComparison.InvariantCultureIgnoreCase);
                        if (indexofTVshow != -1 && difference < 3 && !showAll)
                        {
                            selectedShow = FinalList[0];
                        }
                        else
                        {
                            SelectMenu SelectMain = new SelectMenu(FinalList, ShowName, "Select Correct TVRage Show");
                            if (SelectMain.ShowDialog() == DialogResult.OK)
                            {
                                int selectedid = SelectMain.selected;
                                if (selectedid == -1)
                                {
                                    return(TVShowID);
                                }
                                selectedShow = FinalList[selectedid];
                                SelectMain.Close();
                            }
                        }
                    }
                }


                if (selectedShow.ShowID == -1)
                {
                    return(TVShowID);                      //return if nothing is found
                }
                TVShowID = selectedShow;
            }
            TVShowID.ShowName = TVShowID.ShowName.Replace(":", "").Replace("?", "").Replace("/", "").Replace("<", "").Replace(">", "").Replace("\\", "").Replace("*", "").Replace("|", "").Replace("\"", "");
            return(TVShowID);
        }
示例#6
0
        public OnlineShowInfo findTitle(string ShowName, bool showAll = false)
        {
            List <OnlineShowInfo> selectionList = new List <OnlineShowInfo>();

            OnlineShowInfo TVShowID = new OnlineShowInfo();

            if (ShowName == null)
            {
                return(TVShowID);
            }
            //ShowName = ShowName.Replace("Gold Rush Alaska", "Gold Rush");
            //ShowName = ShowName.Replace("Tosh 0", "Tosh.0");
            List <OnlineShowInfo> FinalList = new List <OnlineShowInfo>();

            try
            {
                SearchContainer <TvShowBase> results = tmdbClient.SearchTvShow(ShowName);

                // Let's iterate the first few hits
                foreach (TvShowBase result in results.Results.Take(10))
                {
                    FinalList.Add(new OnlineShowInfo(result.Name, result.Id, result.FirstAirDate.Value.Year.ToString()));
                }
            }
            catch (Exception e) { }

            if (FinalList != null && FinalList.Count > 0)
            {
                if (FinalList.Count() == 0)
                {
                    return(TVShowID);                                         //return if nothing found
                }
                OnlineShowInfo selectedShow = new OnlineShowInfo();
                if (FinalList.Count() == 1)
                {
                    selectedShow = FinalList[0];
                }
                else
                {
                    if (FinalList.Count() != 0)
                    {
                        int indexofTVshow = -1;
                        int difference    = Math.Abs(FinalList[0].ShowName.Length - ShowName.Length);
                        indexofTVshow = FinalList[0].ShowName.IndexOf(ShowName, StringComparison.InvariantCultureIgnoreCase);
                        if (indexofTVshow != -1 && difference < 3 && !showAll)
                        {
                            selectedShow = FinalList[0];
                        }
                        else
                        {
                            SelectMenu SelectMain = new SelectMenu(FinalList, ShowName, "Select Correct TMDb Show");
                            if (SelectMain.ShowDialog() == DialogResult.OK)
                            {
                                int selectedid = SelectMain.selected;
                                if (selectedid == -1)
                                {
                                    return(TVShowID);
                                }
                                selectedShow = FinalList[selectedid];
                                SelectMain.Close();
                            }
                        }
                    }
                }


                if (selectedShow.ShowID == -1)
                {
                    return(TVShowID);                           //return if nothing is found
                }
                TVShowID = selectedShow;
            }


            try
            {
                TvShow result = tmdbClient.GetTvShow(TVShowID.ShowID);
                TVShowID.ShowEnded = !result.InProduction;
            }
            catch (Exception e) { }


            TVShowID.ShowName = TVShowID.ShowName.Replace(":", "").Replace("?", "").Replace("/", "").Replace("<", "").Replace(">", "").Replace("\\", "").Replace("*", "").Replace("|", "").Replace("\"", "");
            return(TVShowID);
        }