private void SetDefaults() { ManualFolderLocations = new Dictionary <int, List <string> >(); IgnoreSeasons = new List <int>(); UseCustomShowName = false; CustomShowName = ""; UseCustomLanguage = false; UseSequentialMatch = false; SeasonRules = new Dictionary <int, List <ShowRule> >(); SeasonEpisodes = new Dictionary <int, List <ProcessedEpisode> >(); ShowNextAirdate = true; TvdbCode = -1; AutoAddFolderBase = ""; AutoAddCustomFolderFormat = CustomSeasonName.DefaultStyle(); AutoAddType = AutomaticFolderType.libraryDefault; DoRename = true; DoMissingCheck = true; CountSpecials = false; DvdOrder = false; CustomSearchUrl = ""; UseCustomSearchUrl = false; ForceCheckNoAirdate = false; ForceCheckFuture = false; ManualFoldersReplaceAutomatic = false; BannersLastUpdatedOnDisk = null; //assume that the banners are old and have expired ShowTimeZone = TimeZoneHelper.DefaultTimeZone(); // default, is correct for most shows lastFiguredTz = ""; }
public ShowConfiguration() { ManualFolderLocations = new ConcurrentDictionary <int, List <string> >(); SeasonRules = new ConcurrentDictionary <int, List <ShowRule> >(); SeasonEpisodes = new ConcurrentDictionary <int, List <ProcessedEpisode> >(); airedSeasons = new ConcurrentDictionary <int, ProcessedSeason>(); dvdSeasons = new ConcurrentDictionary <int, ProcessedSeason>(); IgnoreSeasons = new List <int>(); UseCustomRegion = false; CustomRegionCode = string.Empty; UseCustomShowName = false; CustomShowName = string.Empty; UseCustomLanguage = false; TvdbCode = -1; TVmazeCode = -1; TmdbCode = -1; UseCustomSearchUrl = false; CustomSearchUrl = string.Empty; UseCustomNamingFormat = false; CustomNamingFormat = string.Empty; ManualFoldersReplaceAutomatic = false; BannersLastUpdatedOnDisk = null; //assume that the banners are old and have expired ShowTimeZone = TVSettings.Instance.DefaultShowTimezoneName ?? TimeZoneHelper.DefaultTimeZone(); // default, is correct for most shows lastFiguredTz = string.Empty; UseSequentialMatch = TVSettings.Instance.DefShowSequentialMatching; UseAirDateMatch = TVSettings.Instance.DefShowAirDateMatching; UseEpNameMatch = TVSettings.Instance.DefShowEpNameMatching; ShowNextAirdate = TVSettings.Instance.DefShowNextAirdate; DoRename = TVSettings.Instance.DefShowDoRenaming; DoMissingCheck = TVSettings.Instance.DefShowDoMissingCheck; CountSpecials = TVSettings.Instance.DefShowSpecialsCount; DvdOrder = TVSettings.Instance.DefShowDVDOrder; ForceCheckNoAirdate = TVSettings.Instance.DefShowIncludeNoAirdate; ForceCheckFuture = TVSettings.Instance.DefShowIncludeFuture; AutoAddCustomFolderFormat = CustomSeasonName.DefaultStyle(); AutoAddFolderBase = !TVSettings.Instance.DefShowAutoFolders ? string.Empty : !TVSettings.Instance.DefShowUseDefLocation ? string.Empty : TVSettings.Instance.DefShowLocation.EnsureEndsWithSeparator() + TVSettings.Instance.FilenameFriendly(FileHelper.MakeValidPath(ShowName)); AutoAddType = !TVSettings.Instance.DefShowAutoFolders ? AutomaticFolderType.none : TVSettings.Instance.DefShowUseBase ? AutomaticFolderType.baseOnly : AutomaticFolderType.libraryDefault; }
public ShowItem([NotNull] XElement xmlSettings) { SetDefaults(); CustomShowName = xmlSettings.ExtractString("ShowName"); UseCustomShowName = xmlSettings.ExtractBool("UseCustomShowName", false); UseCustomLanguage = xmlSettings.ExtractBool("UseCustomLanguage", false); CustomLanguageCode = xmlSettings.ExtractString("CustomLanguageCode"); CustomShowName = xmlSettings.ExtractString("CustomShowName"); TvdbCode = xmlSettings.ExtractInt("TVDBID", -1); CountSpecials = xmlSettings.ExtractBool("CountSpecials", false); ShowNextAirdate = xmlSettings.ExtractBool("ShowNextAirdate", true); AutoAddFolderBase = xmlSettings.ExtractString("FolderBase"); DoRename = xmlSettings.ExtractBool("DoRename", true); DoMissingCheck = xmlSettings.ExtractBool("DoMissingCheck", true); DvdOrder = xmlSettings.ExtractBool("DVDOrder", false); UseCustomSearchUrl = xmlSettings.ExtractBool("UseCustomSearchURL", false); CustomSearchUrl = xmlSettings.ExtractString("CustomSearchURL"); ShowTimeZone = xmlSettings.ExtractString("TimeZone") ?? TimeZoneHelper.DefaultTimeZone(); // default, is correct for most shows; ForceCheckFuture = xmlSettings.ExtractBoolBackupDefault("ForceCheckFuture", "ForceCheckAll", false); ForceCheckNoAirdate = xmlSettings.ExtractBoolBackupDefault("ForceCheckNoAirdate", "ForceCheckAll", false); AutoAddCustomFolderFormat = xmlSettings.ExtractString("CustomFolderFormat") ?? CustomSeasonName.DefaultStyle(); AutoAddType = GetAutoAddType(xmlSettings.ExtractInt("AutoAddType")); BannersLastUpdatedOnDisk = xmlSettings.ExtractDateTime("BannersLastUpdatedOnDisk"); UseSequentialMatch = xmlSettings.ExtractBool("UseSequentialMatch", false); ManualFoldersReplaceAutomatic = xmlSettings.ExtractBool("ManualFoldersReplaceAutomatic", false); SetupIgnoreRules(xmlSettings); SetupAliases(xmlSettings); SetupSeasonRules(xmlSettings); SetupSeasonFolders(xmlSettings); UpgradeFromOldSeasonFormat(xmlSettings); }