Ejemplo n.º 1
0
 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                 = "";
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
        public ShowItem(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") ?? TimeZone.DefaultTimeZone(); // default, is correct for most shows;
            ForceCheckFuture   = xmlSettings.ExtractBool("ForceCheckFuture")
                                 ?? xmlSettings.ExtractBool("ForceCheckAll")
                                 ?? false;
            ForceCheckNoAirdate = xmlSettings.ExtractBool("ForceCheckNoAirdate")
                                  ?? xmlSettings.ExtractBool("ForceCheckAll")
                                  ?? false;
            AutoAddCustomFolderFormat = xmlSettings.ExtractString("CustomFolderFormat") ?? "Season {Season:2}";
            AutoAddType = xmlSettings.ExtractInt("AutoAddType") == null
                ? AutomaticFolderType.libraryDefault
                : (AutomaticFolderType)xmlSettings.ExtractInt("AutoAddType");
            BannersLastUpdatedOnDisk = xmlSettings.ExtractDateTime("BannersLastUpdatedOnDisk");
            UseSequentialMatch       = xmlSettings.ExtractBool("UseSequentialMatch") ?? false;

            SetupIgnoreRules(xmlSettings);
            SetupAliases(xmlSettings);
            SetupSeasonRules(xmlSettings);
            SetupSeasonFolders(xmlSettings);
            UpGradeFromOldSeasonFormat(xmlSettings);
        }
Ejemplo n.º 5
0
        private void UpgradeFromOldSeasonFormat([NotNull] XElement xmlSettings)
        {
            //These variables have been discontinued (JULY 2018).  If we have any then we should migrate to the new values
            bool upgradeFromOldAutoAddFunction = xmlSettings.Descendants("AutoAddNewSeasons").Any() ||
                                                 xmlSettings.Descendants("FolderPerSeason").Any() ||
                                                 xmlSettings.Descendants("SeasonFolderName").Any() ||
                                                 xmlSettings.Descendants("PadSeasonToTwoDigits").Any();
            bool   tempAutoAddNewSeasons       = xmlSettings.ExtractBool("AutoAddNewSeasons", true);
            bool   tempAutoAddFolderPerSeason  = xmlSettings.ExtractBool("FolderPerSeason", true);
            string tempAutoAddSeasonFolderName = xmlSettings.ExtractString("SeasonFolderName");
            bool   tempPadSeasonToTwoDigits    = xmlSettings.ExtractBool("PadSeasonToTwoDigits", true);

            if (upgradeFromOldAutoAddFunction)
            {
                if (tempAutoAddNewSeasons)
                {
                    if (tempAutoAddFolderPerSeason)
                    {
                        AutoAddCustomFolderFormat = tempAutoAddSeasonFolderName + ((tempPadSeasonToTwoDigits || TVSettings.Instance.LeadingZeroOnSeason) ? "{Season:2}" : "{Season}");
                        AutoAddType = (AutoAddCustomFolderFormat == TVSettings.Instance.SeasonFolderFormat)
                            ? AutomaticFolderType.libraryDefault
                            : AutomaticFolderType.custom;
                    }
                    else
                    {
                        AutoAddCustomFolderFormat = string.Empty;
                        AutoAddType = AutomaticFolderType.baseOnly;
                    }
                }
                else
                {
                    AutoAddCustomFolderFormat = string.Empty;
                    AutoAddType = AutomaticFolderType.none;
                }
            }
        }