Commit Graph

26 Commits

Author SHA1 Message Date
Claude
4e794879e5 Refactor fuzzy matcher patterns for granular control
Changes:
1. Categorize HARDCODED_IGNORE_PATTERNS into 4 distinct lists:
   - QUALITY_PATTERNS: Quality tags ([4K], HD, (SD), etc.)
   - REGIONAL_PATTERNS: Regional indicators (East)
   - GEOGRAPHIC_PATTERNS: Geographic prefixes (US:, USA:)
   - MISC_PATTERNS: Miscellaneous patterns ((CX), (Backup), single-letter tags)

2. Update normalize_name function signature:
   - Remove remove_quality_tags parameter
   - Add ignore_quality, ignore_regional, ignore_geographic, ignore_misc (all default to True)
   - Maintains backward compatibility with default True values

3. Implement dynamic pattern application:
   - Build patterns_to_apply list based on category flags
   - Apply only selected pattern categories

4. Improve user_ignored_tags handling:
   - Tags with brackets/parentheses: literal match
   - Simple word tags: use word boundaries (\b) to avoid partial matches
   - Fixes issue where "East" tag would incorrectly match "east" in "Feast"

5. Update version to 25.313.1157 (Julian date: Nov 9, 2025 11:57 AM)

This refactoring enables future UI controls for granular pattern filtering
while maintaining full backward compatibility.
2025-11-09 18:01:25 +00:00
Pirates IRC
2b60dc0eb2 Merge pull request #7 from PiratesIRC/claude/multi-profile-validation-csv-headers-011CUvkSt1wZzVhCwFmCN7vw
Add multi-profile support and CSV comment headers
2025-11-08 10:50:55 -06:00
Claude
066c9cf956 Add multi-profile support, settings validation, and CSV headers
Features:
- Multi-profile support: Profile Name field now accepts comma-separated list
- Validate Settings button: New first action to validate all settings
  - Checks API connection
  - Validates all profiles exist
  - Validates all groups exist
  - Verifies fuzzy matcher initialization
- CSV headers: All generated CSV files now include comment headers with:
  - Plugin version
  - All applicable settings (Overwrite, Threshold, Profiles, Groups, Tags, Limit)
  - Statistics (visible channels, total streams, matched streams)

Changes:
- Updated Profile Name field help text and placeholder
- Modified load_process_channels_action to handle multiple profiles
- Added validate_settings_action method with comprehensive validation
- Added _generate_csv_header_comment helper method
- Updated all three CSV exports (preview, update, visibility) to include headers
2025-11-08 16:43:09 +00:00
Pirates IRC
ba90a0aaa0 0.5.0b 2025-11-08 10:13:44 -06:00
Pirates IRC
dc603625d8 Merge pull request #6 from PiratesIRC/claude/debug-issue-011CUrxaBXUrfZBk1W1XDBVp
Debug and fix code issues
2025-11-08 10:11:36 -06:00
Claude
c8a982c4ab Add Julian date version numbering to fuzzy_matcher.py
Add __version__ constant using Julian date format: YY.DDD.HHMM
- YY: Two-digit year (25 = 2025)
- DDD: Day of year (310 = November 6th)
- HHMM: Time in 24-hour format (1806 = 6:06 PM)

Version: 25.310.1806

This provides a clear, sortable version number that indicates exactly
when the last modification was made.
2025-11-06 18:06:49 +00:00
Claude
95df38905b Ensure consistent quality tag matching across all pattern types
Fix inconsistency where some quality tags were only matched in bracketed
format but not in unbracketed format, causing streams with unbracketed
quality tags to be excluded from matching.

Previous issue:
- [4K], [Unknown], [Unk], [Slow], [Dead] were matched (bracketed)
- But "4K", "Unknown", "Unk", "Slow", "Dead" were NOT matched (unbracketed)

This caused streams like:
- "BBC One 4K" (no brackets) - NOT normalized, NOT matched
- "BBC One Unknown" - NOT normalized, NOT matched
- "ESPN (Slow)" - NOT normalized, NOT matched

Changes to HARDCODED_IGNORE_PATTERNS:
- Added 4K, Unknown, Unk, Slow, Dead to middle pattern: " TAG "
- Added 4K, Unknown, Unk, Slow, Dead to end pattern: " TAG"
- Added 4K, Unknown, Unk, Slow, Dead to colon pattern: "TAG:"
- Added 4K, Unknown, Unk, Slow, Dead to parentheses pattern: (TAG)
- Added inline documentation for each pattern type
- Note: All patterns already use re.IGNORECASE for case-insensitive matching

Now ALL quality tags are handled consistently across:
- Bracketed: [TAG] ✓
- Unbracketed at end: " TAG" ✓
- Unbracketed in middle: " TAG " ✓
- Parenthesized: (TAG) ✓
- With colon: "TAG:" ✓

This ensures no quality tags are missed regardless of format.
2025-11-06 18:04:33 +00:00
Claude
0c0b045e68 Add FHD and UHD support to stream quality matching
Fix bug where FHD and UHD streams were not being matched to channels.
The HARDCODED_IGNORE_PATTERNS were missing FHD and UHD in several regex
patterns, causing streams like "BBC one FHD" to fail normalization and
be excluded from matching results.

Changes:
- Add FHD and UHD to bracketed quality patterns: [FHD], [UHD], [fhd], [uhd]
- Add FHD and UHD to unbracketed quality patterns at end: " FHD", " UHD"
- Add FHD and UHD to parentheses patterns: (FHD), (UHD)
- Add FHD and UHD to word boundary patterns: "FHD:", "UHD:"
- Add UHD to STREAM_QUALITY_ORDER for proper quality sorting
- Add UHD to CHANNEL_QUALITY_TAG_ORDER for channel prioritization

This ensures streams with FHD/UHD quality tags are properly normalized
and matched alongside HD and SD streams.

Fixes issue where only HD and SD streams were matched while FHD streams
were ignored.
2025-11-06 18:01:16 +00:00
Pirates IRC
765266a51e Merge pull request #5 from PiratesIRC/claude/fuzzymatcher-ignore-cinemax-011CUrk7Kz5VHK1xuFeNzKbs
Fix fuzzymatcher to ignore Cinemax in channel names
2025-11-06 07:53:34 -06:00
Claude
2d9cf4347c Improve Cinemax removal regex in fuzzy matcher
- Updated regex from '\bCinemax\s+' to '\bCinemax\b\s*'
- Now handles edge cases like Cinemax at end of string
- Matches Cinemax as complete word with optional trailing spaces
- Ensures proper matching for channels containing 'max'
2025-11-06 13:52:45 +00:00
Pirates IRC
9b71b20293 Merge pull request #4 from PiratesIRC/claude/fix-visibility-add-emojis-011CUrgQDHW2FZ25e9XdPjNi
Claude/fix visibility add emojis 011 c urg qdhw2 fz25e9 xd pj ni
2025-11-06 07:35:43 -06:00
Claude
ec65d904a1 Remove WebSocket notifications from plugin
The WebSocket notifications require frontend handlers in Dispatcharr's
WebSocket.jsx that cannot be added from the plugin code. Removed all
send_websocket_update() calls to avoid sending notifications that won't
be displayed.

The plugin still logs progress to the console for debugging.

Changes:
- Remove import of send_websocket_update
- Remove all WebSocket notification calls from:
  * preview_changes_action
  * add_streams_to_channels_action
  * manage_channel_visibility_action
- Progress is still logged via standard logging
2025-11-06 13:34:42 +00:00
Claude
05860d3a2f Add Cinemax handling for channels containing 'max'
When a channel name contains "max" (case insensitive), the plugin
now removes "Cinemax" from stream names during matching. This allows
channels like "5StarMax" to properly match streams like:
- US: Cinemax 5Starmax
- US 5STARMAX (East) (H)
- US: 5 STARMAX

Changes:
- Add remove_cinemax parameter to normalize_name() in fuzzy_matcher.py
- Add remove_cinemax parameter to _clean_channel_name() in plugin.py
- Detect if channel name contains "max" in _match_streams_to_channel()
- Pass remove_cinemax=True to all stream name cleaning when applicable
- Update fuzzy_match() and find_best_match() to support Cinemax removal

This improves matching accuracy for Cinemax channels that include
the network name in stream names but not in channel names.
2025-11-06 13:26:15 +00:00
Claude
03b8bfc31e Add emojis, fix visibility logic, and add WebSocket notifications
Changes:
- Add tasteful emojis to plugin GUI fields and action labels
- Fix bug: iterate sorted_channels instead of group_channels (line 1411)
- Fix visibility logic: enable channels with >= 1 streams instead of 0-1
  * Channels with >= 1 streams are now enabled (highest priority only)
  * Channels with 0 streams are disabled
  * Duplicate channels (lower priority in group) are disabled
  * Attached channels remain disabled
- Add real-time WebSocket progress notifications for:
  * Preview Changes action (stream_mapparr_preview)
  * Add Streams to Channels action (stream_mapparr_add)
  * Manage Channel Visibility action (stream_mapparr_visibility)
- Update action descriptions to reflect corrected behavior

This resolves the contradiction where add_streams_to_channels would
create channels with multiple streams, and manage_channel_visibility
would immediately disable them.
2025-11-06 13:11:31 +00:00
Pirates IRC
8b75a7e296 Merge pull request #3 from PiratesIRC/claude/debug-stream-count-error-011CUm6dug1DMDcmxEoHQcXB
Fix KeyError: 'stream_count' in manage_channel_visibility
2025-11-03 08:22:04 -06:00
Claude
331355e846 Fix KeyError: 'stream_count' in manage_channel_visibility
Root cause: Lines 1414-1415 were trying to access non-existent fields
'stream_count' and 'attached' directly from channel objects. These values
are actually stored in the channel_stream_counts dictionary and
channels_attached_to_others set respectively.

Changes:
- Fixed field access to use correct data structures
- Added error handling to check if channel exists in stream_counts
- Added debug logging to show evaluation details for each channel
- Added full traceback logging in exception handler for better debugging

This fixes the error: "Error managing channel visibility: 'stream_count'"
2025-11-03 14:20:05 +00:00
Pirates IRC
ac6f377636 0.5.0a 2025-11-03 08:16:16 -06:00
Pirates IRC
09d1651a14 v0.4 2025-10-31 16:06:38 -05:00
Pirates IRC
b296babff2 Revise README for improved clarity and detail
Updated README to enhance clarity and detail regarding plugin features, installation, and usage instructions.
2025-10-31 16:06:00 -05:00
Pirates IRC
faa35afebe Update README.md 2025-10-24 06:47:40 -05:00
Pirates IRC
5b51c64ced v0.3 2025-10-24 06:37:21 -05:00
Pirates IRC
85225fcf50 Update README.md 2025-10-09 11:46:18 -05:00
Pirates IRC
6430fe0745 v0.2 2025-10-09 11:30:19 -05:00
Pirates IRC
a07dda69ee Initial 2025-10-01 19:01:07 -05:00
Pirates IRC
80e3e5c7d3 Update README.md 2025-10-01 19:00:19 -05:00
Pirates IRC
fae5e86b25 Initial commit 2025-10-01 18:55:11 -05:00