public bool IsModuleIncluded(string module)
        {
            // Use "Include" list.
            if (IsManualLoad)
            {
                return(IncludeList.Any(includePattern =>
                                       Regex.IsMatch(module, WildcardToRegex(includePattern),
                                                     RegexOptions.IgnoreCase)));
            }

            // Use "Exclude" list.
            return(!ExcludeList.Any(excludePattern =>
                                    Regex.IsMatch(module, WildcardToRegex(excludePattern),
                                                  RegexOptions.IgnoreCase)));
        }
Exemplo n.º 2
0
        public bool ShouldDownload(Torrent item)
        {
            if (Enabled)
            {
                if (!DownloadedTorrents.Contains(item))
                {
                    string       title  = Utils.RemoveDiacritics(IgnoreCaps ? item.Title.ToLower() : item.Title);
                    RegexOptions option = IgnoreCaps ? RegexOptions.IgnoreCase : RegexOptions.None;

                    if (Regex.IsMatch(title, RegexPattern, option))
                    {
                        if (IncludeList.All(title.Contains))
                        {
                            if (!ExcludeList.Any(title.Contains))
                            {
                                if (IsTV)
                                {
                                    if (item.IsTV)
                                    {
                                        if (IsEpisodeToDownload(item))
                                        {
                                            return(true);
                                        }
                                    }
                                }
                                else
                                {
                                    return(true);
                                }
                            }
                        }
                    }
                }
            }

            return(false);
        }