| @@ 90-99 (lines=10) @@ | ||
| 87 | logging.info(f"Recently pinned non-special collections (excluded): {', '.join(sorted(list(recent_titles)))}") |
|
| 88 | return recent_titles # This set now only contains non-special recently pinned items |
|
| 89 | ||
| 90 | def is_regex_excluded(title, patterns): |
|
| 91 | """Checks if a title matches any regex pattern.""" |
|
| 92 | if not patterns or not isinstance(patterns, list): return False |
|
| 93 | try: |
|
| 94 | for pattern in patterns: |
|
| 95 | if not isinstance(pattern, str) or not pattern: continue |
|
| 96 | if re.search(pattern, title, re.IGNORECASE): logging.info(f"Excluding '{title}' (regex: '{pattern}')"); return True |
|
| 97 | except re.error as e: logging.error(f"Invalid regex '{pattern}': {e}"); return False |
|
| 98 | except Exception as e: logging.error(f"Regex error for '{title}', pattern '{pattern}': {e}"); return False |
|
| 99 | return False |
|
| 100 | ||
| 101 | def load_config(): |
|
| 102 | """Loads configuration from config.json, exits on critical errors.""" |
|
| @@ 90-99 (lines=10) @@ | ||
| 87 | logging.info(f"Recently pinned non-special collections (excluded): {', '.join(sorted(list(recent_titles)))}") |
|
| 88 | return recent_titles # This set now only contains non-special recently pinned items |
|
| 89 | ||
| 90 | def is_regex_excluded(title, patterns): |
|
| 91 | """Checks if a title matches any regex pattern.""" |
|
| 92 | if not patterns or not isinstance(patterns, list): return False |
|
| 93 | try: |
|
| 94 | for pattern in patterns: |
|
| 95 | if not isinstance(pattern, str) or not pattern: continue |
|
| 96 | if re.search(pattern, title, re.IGNORECASE): logging.info(f"Excluding '{title}' (regex: '{pattern}')"); return True |
|
| 97 | except re.error as e: logging.error(f"Invalid regex '{pattern}': {e}"); return False |
|
| 98 | except Exception as e: logging.error(f"Regex error for '{title}', pattern '{pattern}': {e}"); return False |
|
| 99 | return False |
|
| 100 | ||
| 101 | def load_config(): |
|
| 102 | """Loads configuration from config.json, exits on critical errors.""" |
|