//Read XML file with TVShowListLoad Names and such
		private void TVShowListLoad(string FileLocation, List<TVShowInfo> loadedItem)
		{
			XDocument TVShowListXML = XDocument.Load(FileLocation);

			var TVShowLists = from TVShowList in TVShowListXML.Descendants("TVShow")
							select new
							{
								TVShowName = TVShowList.Element("TVShowName").Value,
								TVShowFolder = TVShowList.Element("TVShowFolder").Value,
								TVDBID = TVShowList.Element("TVDBID").Value,
								TVDBShowName = TVShowList.Element("TVDBShowName").Value,
								RageTVID = TVShowList.Element("RageTVID").Value,
								RageShowName = TVShowList.Element("RageShowName").Value,
								EpguidesID = TVShowList.Element("EpguidesID").Value,
								EPGShowName = TVShowList.Element("EPGShowName").Value
							};

			foreach (var wd in TVShowLists)
				loadedItem.Add(new TVShowInfo(wd.TVShowName, wd.TVShowFolder, Int32.Parse(wd.TVDBID),wd.TVDBShowName,Int32.Parse(wd.RageTVID),wd.RageShowName,wd.EpguidesID,wd.EPGShowName));			
		}
        /// <summary>
        /// Searches the TMDb database for a TV season based on a given path using a TMdbEasy.EasyClient class instance.
        /// </summary>
        /// <param name="easy">A TMdbEasy.EasyClient class instance to use for the search.</param>
        /// <param name="path">A path to enumerate files from.</param>
        /// <param name="stillSize">The size of the still image to get the URL for.</param>
        /// <param name="excludeFileNames">File names to be left out of the search.</param>
        /// <returns>A collection of TMDbDetail class instances containing the TV show season information from the TMDb database.</returns>
        public static async Task <IEnumerable <TMDbDetail> > GetSeasonAsync(EasyClient easy, string path, string stillSize = "original", List <string> excludeFileNames = null)
        {
            var televisionApi = easy.GetApi <ITelevisionApi>().Value; // create a ITelevisionApi..

            // avoid the null value..
            excludeFileNames = excludeFileNames ?? new List <string>();

            string fileName = string.Empty;

            if (File.Exists(path))
            {
                fileName = path;
                path     = Path.GetDirectoryName(path);
            }

            // List files of known video formats from the given path..
            IEnumerable <FileEnumeratorFileEntry> fileEntries =
                await FileEnumerator.RecurseFilesAsync(path, FileEnumerator.FiltersVideoVlcNoBinNoIso).ConfigureAwait(false);

            // remove the "useless" files from the list..
            List <FileEnumeratorFileEntry> tmpFilesList = new List <FileEnumeratorFileEntry>();

            // not in the include list..
            if (fileName != string.Empty)
            {
                fileEntries = fileEntries.Where(f => f.FileNameWithPath == fileName);
            }

            foreach (FileEnumeratorFileEntry entry in fileEntries.ToList())
            {
                // excluded from the list..
                if (excludeFileNames.Contains(entry.FileName))
                {
                    continue;            // ..so do continue..
                }
                tmpFilesList.Add(entry); // ..else add to the list..
            }

            fileEntries = tmpFilesList; // re-assign the list back to the source..

            // don't start searching if the directory is empty - we don't want to cause excess stress for the TMDb database..
            if (fileEntries.ToList().Count == 0)
            {
                // ..so just throw an exception..
                throw new Exception("No files were found from the given path string.");
            }

            // construct a search string of the given path..
            string searchString = GetTVShowSearchString(path);
            int    season       = GetTVShowSeason(path); // extract a season number from the given path..

            if (season == -1)                            // if no season number was in the given path..
            {
                // ..just throw an exception..
                throw new Exception("The TV season number wasn't found of the given path string.");
            }

            // initialize the result..
            List <TMDbDetail> result = new List <TMDbDetail>();

            // search for TV shows base on the search string build from the given directory name..
            TVShowList list = await televisionApi.SearchTVShowsAsync(searchString).ConfigureAwait(false);

            // if something was found..
            if (list != null && list.Total_results > 0)   // ..deepen the search..
            {
                string seriesName = list.Results[0].Name; // save the name of the TV show..
                int    seriesID   = list.Results[0].Id;   // save the ID of the TV show..

                // find the TV show season from the TMDb database with an ID and a season number..
                TvSeason tvSeason = await televisionApi.GetSeasonDetailsAsync(seriesID, season).ConfigureAwait(false);

                // if something was found..
                if (tvSeason != null && tvSeason.Episodes != null)
                {
                    foreach (Episode episode in tvSeason.Episodes) // return the details of the TV show season..
                    {
                        // don't return a file-less TMDbDetail class instance..
                        if (GetFileNameMatchingTVSeasonEpisode(fileEntries, season, episode.Episode_number) == null)
                        {
                            continue; // ..so just continue the loop..
                        }

                        result.Add(new TMDbDetail
                        {
                            ID        = seriesID,    // the TMDb id for the TV show..
                            SeasonID  = tvSeason.Id, // the TMDb id for the TV show season..
                            EpisodeID = episode.Id,  // the TMDb id for the TV show season episode..

                            // formulate the title base on the TVEpisodeFormat or the "overriding" TVEpisodeFormatCustom property value..
                            Title = TVEpisodeFormatCustom != string.Empty ?
                                    TVEpisodeFormatCustom.
                                    Replace("#SNUM#", tvSeason.Season_number.ToString()).                 // the season number as one digit..
                                    Replace("#ENUM#", episode.Episode_number.ToString()).                 // the episode number as one digit..
                                    Replace("#EPISODE_NAME#", episode.Name).                              // the name of the episode..
                                    Replace("#SERIES_NAME#", seriesName).                                 // the name of the series..
                                    Replace("#SEASON_NAME#", tvSeason.Name).                              // the name of the TV show season..
                                    Replace("#SNUM2#", string.Format("{0:00}", tvSeason.Season_number)).  // the season number as two digits..
                                    Replace("#ENUM2#", string.Format("{0:00}", episode.Episode_number)) : // the episode number as two digits..
                                    string.Format(TVEpisodeFormat, seriesName, tvSeason.Name, episode.Episode_number, episode.Name),

                            // set the description..
                            Description       = string.IsNullOrEmpty(tvSeason.Overview) ? episode.Overview : tvSeason.Overview,
                            DetailDescription = episode.Overview, // set the detailed description if any..

                            // find the file name for the TV show episode..
                            FileName = GetFileNameMatchingTVSeasonEpisode(fileEntries, season, episode.Episode_number).FileName,

                            // create an URL for the still using the TV season's poster path as a "fail safe"..
                            PosterOrStillURL = new Uri("https://image.tmdb.org/t/p/" + stillSize +
                                                       (string.IsNullOrEmpty(episode.Still_path) ? tvSeason.Poster_path : episode.Still_path)),
                            Season  = season,                // set the season number..
                            Episode = episode.Episode_number // set the episode number..
                        });
                    }
                }
                else // nothing was found..
                {
                    // loop through the found files..
                    foreach (FileEnumeratorFileEntry entry in fileEntries)
                    {
                        result.Add(new TMDbDetail
                        {
                            Title    = entry.FileNameNoExtension,             // the title can be the file name without path or extension..
                            FileName = entry.FileName,                        // set the file name..
                            Season   = season,                                // set the season number..
                            Episode  = GetTVShowEpisodeNumber(entry.FileName) // set the episode number..
                        });
                    }
                }
            }
            return(result);
        }