Commit Graph

108 Commits

Author SHA1 Message Date
joren
c3e5a7135a refactor: performance and code quality improvements
- Move `import traceback` to module level (was duplicated in 9 method bodies)
- Cache `_get_channel_databases()` result to avoid re-reading JSON files on every call
- `_get_all_streams()` now fetches `width`/`height` so dead-stream filtering needs no extra DB queries
- `_filter_working_streams()`: replace N individual ORM queries with one bulk `filter(id__in=...)` query
- `_sort_streams_by_quality()`: add explicit `prioritize_quality` parameter instead of hidden instance state
- `sort_streams_action()`: read and pass `prioritize_quality` from settings
- Extract `_parse_channel_file()` helper in fuzzy_matcher.py to eliminate duplicated parsing loop
- Simplify `REGIONAL_PATTERNS` — removed verbose `[Ee][Aa][Ss][Tt]` style since `re.IGNORECASE` is always applied

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 22:49:25 +02:00
PiratesIRC
54a44733aa chore: add all AI/tool config patterns to .gitignore
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 22:19:33 -05:00
PiratesIRC
9809fe7926 chore: add CLAUDE.md to .gitignore and remove from tracking
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 22:17:57 -05:00
PiratesIRC
6063b35336 docs: update CLAUDE.md for v0.9.0
Reflect ORM architecture, rapidfuzz + normalization cache,
simplified UI settings, and current version references.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 22:16:42 -05:00
PiratesIRC
f14197b6b9 docs: update README for v0.9.0
Reflect new UI (dropdown settings), performance optimizations (rapidfuzz,
normalization cache), and simplified settings reference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 22:11:34 -05:00
PiratesIRC
47250b5781 v0.9.0: Performance optimizations + UI simplification
Performance (ported from Linearr):
- rapidfuzz C extension for Levenshtein (20-50x faster when available)
- Pure Python early termination fallback via threshold parameter
- Normalization cache: precompute_normalizations() avoids redundant normalize_name() calls
- fuzzy_match() and find_best_match() use cached results
- ETA updated from 7.73s to 0.1s per item

UI simplification:
- Profile Name: free text → dynamic dropdown from database
- Match Sensitivity: number 0-100 → named presets (Relaxed/Normal/Strict/Exact)
- Tag Handling: 4 booleans → single dropdown (Strip All/Keep Regional/Keep All)
- Channel Database: per-country booleans → single dropdown
- All changes backward compatible with legacy field IDs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 22:05:13 -05:00
Pirates IRC
ca19976ff7 0.8.0b 2026-03-11 17:37:34 -05:00
Pirates IRC
c1135eb8a0 Compatibility for Dispatcharr 0.2x 2026-03-09 04:17:59 -05:00
Pirates IRC
2c3cbf1155 Merge pull request #24 from kabobandrice/feature/prioritize-quality-sorting
Add prioritize quality option for alternate stream sorting
2026-02-01 07:20:07 -06:00
kabobandrice
3e1a35690d Add prioritize quality option for alternate stream sorting
- Add new 'prioritize_quality' boolean setting (default: False)
- When enabled, sorts streams by quality first, then M3U source priority
- When disabled, maintains original M3U-first sorting behavior
- Update CSV export header to include prioritize_quality setting
- Allows ordering like: Source1 UHD, Source2 UHD, Source1 FHD, Source2 FHD
2025-12-30 15:55:43 -08:00
Pirates IRC
833ba094fc 0.7.3
# Stream-Mapparr Plugin Changelog (v0.7.2 -> v0.7.3)

### Matching Logic Improvements
- Implemented a length ratio check (75%) for substring matches to prevent partial word false positives (e.g., preventing "story" from matching "history").
- Added strict validation for numeric tokens; streams must now explicitly contain matching numbers if the channel name includes them (e.g., prevents "BBC1" from matching "CBBC").

### Features
- Added the underlying FuzzyMatcher library version number to the header of generated CSV export files for better debugging.

### Maintenance
- Updated the minimum required FuzzyMatcher version to 25.358.0200.
2025-12-28 07:34:00 -06:00
Pirates IRC
bcf9cebbc3 Add files via upload
# Stream-Mapparr v0.7.2

 

## What Was Fixed
Updated fuzzy_matcher.py dependency to include complete regional pattern support for all US timezone indicators.
 

## The Issue
- "E! Entertainment" was incorrectly matching `USA: E! ENTERTAINMENT (WEST)`
- fuzzy_matcher.py only recognized "East", missing West/Pacific/Central/Mountain/Atlantic
- Affected users with `Ignore Regional Tags: False` setting

 

## The Solution

**plugin.py v0.7.2**:
- Updated version to 0.7.2
- Added minimum fuzzy_matcher version requirement: 25.354.1835

 

**fuzzy_matcher.py v25.354.1835** (required dependency):
- Added 5 missing regional indicators: West, Pacific, Central, Mountain, Atlantic
- Each in both word format (` West`) and parenthesized format (`(West)`)
- Updated extract_tags() to recognize all regional indicators
2025-12-20 18:40:48 -06:00
Pirates IRC
42059051c6 Update backup instructions link in README 2025-12-20 11:05:40 -06:00
Pirates IRC
a118fbc9e2 0.7.1
## M3U Source Prioritization

Stream-Mapparr allows you to prioritize streams from specific M3U providers, ensuring your preferred sources are always selected first, regardless of quality metrics.

### How It Works

When you specify M3U sources in the **"📡 M3U Sources"** setting, streams are sorted using a multi-level hierarchy:

1. **M3U Priority** (0 = highest) - Based on order in your comma-separated list
2. **Quality Tier** - High (HD+FPS) > Medium > Low > Dead
3. **Resolution** - Higher resolution preferred within tier
4. **FPS** - Higher framerate preferred within tier

### Example Scenario

**Settings:**
```
M3U Sources: Premium Sports, Backup Provider, Free Streams
```

**Matched Streams for "ESPN":**
- ESPN HD (Premium Sports, 1920x1080, 60fps) → Priority 0, High Quality
- ESPN UHD (Free Streams, 3840x2160, 60fps) → Priority 2, High Quality
- ESPN SD (Premium Sports, 854x480, 30fps) → Priority 0, Low Quality
- ESPN FHD (Backup Provider, 1920x1080, 30fps) → Priority 1, Medium Quality

**Sorted Order:**
1. ESPN HD (Premium Sports) - Priority 0, High Quality ← Best overall
2. ESPN SD (Premium Sports) - Priority 0, Low Quality ← Same provider
3. ESPN FHD (Backup Provider) - Priority 1, Medium Quality
4. ESPN UHD (Free Streams) - Priority 2, High Quality ← Despite being 4K, sorted last

### Configuration

1. Navigate to the Stream-Mapparr plugin settings
2. Find the **"📡 M3U Sources (comma-separated, prioritized)"** field
3. Enter your M3U provider names in priority order, separated by commas:
```
   Premium IPTV, Local M3U, Backup Provider
```
4. Save settings and run "Load/Process Channels" or "Sort Alternate Streams"

### Use Cases

- **Primary/Backup Providers**: Prioritize premium providers over backup sources for reliability
- **Regional Preferences**: Prioritize local M3U sources for better geographic performance
- **Quality Control**: Use specific providers known for better encoding/stability
- **Cost Optimization**: Prioritize cheaper sources when quality differences are negligible

### Notes

- Leave the M3U Sources field **empty** to disable prioritization (streams sort by quality only)
- Order matters: the **first** M3U in the list gets **highest** priority
- Prioritization applies to both "Match & Assign Streams" and "Sort Alternate Streams" actions
- Streams from unspecified M3U sources receive lowest priority (999)
2025-12-20 11:03:34 -06:00
Pirates IRC
6e4a642544 Enhance README with M3U prioritization and logs info
Added details about M3U source prioritization and updated monitoring instructions.
2025-12-20 11:02:18 -06:00
Pirates IRC
caeb7f204a Revise background operations section in README
Updated the README to clarify background operations and monitoring instructions for version 0.6.0 and later.
2025-12-17 11:39:32 -06:00
Pirates IRC
a0bdc7f543 Merge pull request #23 from rolandb5/main
Added Dutch databse
2025-12-17 11:38:24 -06:00
Pirates IRC
9a2be8b74e 0.7.0 2025-12-17 11:28:10 -06:00
rolandb5
c6222ca38c Added Dutch databse 2025-12-14 21:30:02 +01:00
Pirates IRC
7f2063d216 Updated UK channel list 2025-12-02 14:51:45 -06:00
Pirates IRC
091c9fc44a Update README.md 2025-11-29 18:04:46 -06:00
Pirates IRC
52b0abf34e Update README with v0.6.0 background operation details
Added important information regarding background operations and monitoring for version 0.6.0, including changes to user interaction and log checking.
2025-11-29 17:56:43 -06:00
Pirates IRC
05da565539 Update README.md 2025-11-29 17:45:10 -06:00
Pirates IRC
a7741169e2 Add MIT License to the project 2025-11-29 17:44:35 -06:00
Pirates IRC
56b43c6459 Rearrange badge order in README.md 2025-11-29 17:43:18 -06:00
Pirates IRC
bbc9a79f86 Update README.md 2025-11-29 17:42:52 -06:00
Pirates IRC
69a17ee035 Enhance README with more status badges
Added additional badges for last commit, issues, pull requests, top language, repo size, and license.
2025-11-29 17:42:23 -06:00
Pirates IRC
60a2b2710f Update README.md badges
Updated Dispatcharr plugin badge color and removed language and repo size badges.
2025-11-29 17:40:34 -06:00
Pirates IRC
ed711ce702 Remove static badge from README
Removed static badge from README.md.
2025-11-29 17:39:55 -06:00
Pirates IRC
a064d17fd2 Update README.md badges and plugin information
Removed issues and PR badges, added static badge for Dispatcharr plugin.
2025-11-29 17:38:20 -06:00
Pirates IRC
7f7482be57 Update README.md 2025-11-29 17:37:25 -06:00
Pirates IRC
41977fe155 Update badges in README.md
Updated Discord badge and added GitHub release badge.
2025-11-29 17:33:59 -06:00
Pirates IRC
4d7ce7b490 Enhance README with additional badges
Added Discord and Last Updated badges to README.
2025-11-29 17:29:21 -06:00
Pirates IRC
178ff621c5 Updated to 25.333.1800 2025-11-29 16:13:59 -06:00
Pirates IRC
18898ad676 v0.6.0 2025-11-29 16:03:41 -06:00
Pirates IRC
c509cec203 Merge pull request #22 from PiratesIRC/claude/debug-stream-api-json-017BZwHDvFFpCCSU2kgBu595
Debug invalid JSON response from stream API
2025-11-28 18:26:21 -06:00
Claude
4a037a57d2 Change default settings for Rate Limiting and Fuzzy Match Threshold
Changed default values:
- Rate Limiting: "medium" → "none" (disabled by default)
- Fuzzy Match Threshold: 85 → 65 (more permissive matching)

Updated all fallback values in settings.get() calls throughout the codebase
to ensure consistency with the new defaults.
2025-11-29 00:25:36 +00:00
Claude
585eb852f9 Fix API endpoint URLs and stream filtering
Fixed incorrect API endpoint paths that were causing JSON parsing errors:
- Changed /api/channels/stream-groups/ to /api/channels/streams/groups/ (correct endpoint)
- Changed /api/channels/m3us/ to /api/m3u/accounts/ (correct endpoint)
- Removed pagination loops since both endpoints return simple arrays, not paginated responses

Fixed stream filtering to use correct field names:
- Changed stream_group_id to channel_group (streams use channel_group FK)
- Changed m3u_id to m3u_account (streams use m3u_account FK)
- Use group_name_to_id instead of stream_group_name_to_id (stream groups endpoint returns strings, not objects)

These changes resolve the "Expecting value: line 1 column 1 (char 0)" JSON errors.
2025-11-29 00:13:53 +00:00
Pirates IRC
bca85671ef Merge pull request #21 from PiratesIRC/claude/load-stream-channels-012LfQzBK784pksq6JFLby6b
Load and validate stream channel data
2025-11-28 15:25:40 -06:00
Claude
7700666843 Fix JSON parsing errors for empty API responses
Added proper error handling for API endpoints that return empty or invalid JSON responses. This prevents JSONDecodeError exceptions when the StreamMaster API returns empty content.

Changes:
- Added empty response checking before JSON parsing in _get_api_data, _patch_api_data, and _post_api_data methods
- Added try-except blocks to catch json.JSONDecodeError with helpful error messages
- Return appropriate empty values ([] for GET, {} for PATCH/POST) when response is empty
- Added debug logging to show response content when JSON parsing fails

Fixes errors like: "Expecting value: line 1 column 1 (char 0)" when calling /api/channels/stream-groups/ and /api/channels/m3us/ endpoints
2025-11-28 21:17:23 +00:00
Pirates IRC
6ba734fd5c Merge pull request #20 from PiratesIRC/claude/add-stream-group-filter-01JSc4xu35T9sUJNLXXWkTCJ
Add group filter field for streams
2025-11-28 12:34:32 -06:00
Claude
05a89bfb27 Add M3U source filter feature
- Add new 'selected_m3us' setting field to filter streams by M3U source
- Fetch M3U sources from API endpoint /api/channels/m3us/
- Filter streams based on selected M3U sources (comma-separated or blank for ALL)
- Update CSV header comments to display selected M3U sources
- Store selected_m3us in processed_data for persistence
- Apply filter in both Preview Changes and Add Streams actions

This allows users to limit which streams are considered during matching
by specifying M3U source names (e.g., "IPTV Provider 1, Local M3U") or
leaving blank to use all available M3U sources. Works in conjunction with
the stream group filter for fine-grained stream selection.
2025-11-28 18:32:38 +00:00
Claude
be5579500d Add stream group filter feature
- Add new 'selected_stream_groups' setting field to filter streams by group
- Fetch stream groups from API endpoint /api/channels/stream-groups/
- Filter streams based on selected stream groups (comma-separated or blank for ALL)
- Update CSV header comments to display selected stream groups
- Store selected_stream_groups in processed_data for persistence
- Apply filter in both Preview Changes and Add Streams actions

This allows users to limit which streams are considered during matching
by specifying stream group names (e.g., "TVE, Cable") or leaving blank
to use all available stream groups.
2025-11-28 18:15:40 +00:00
Pirates IRC
ade6a9f4f6 0.6.0d 2025-11-28 11:57:38 -06:00
Pirates IRC
375433adbf Merge pull request #19 from PiratesIRC/claude/fix-stream-mapparr-channels-01HW2MuLHZwJZZvRovPCZuas
Fix missing channel handling in Stream-Mapparr
2025-11-28 11:55:28 -06:00
Claude
650e62ad4b Refactor: Comprehensive logging level review and cleanup
Additional logs moved to DEBUG level:
- Settings and configuration operations (loaded/saved settings, schedule config)
- API request details (PATCH/POST requests, token caching)
- Internal operations (frontend refresh, WebSocket updates)
- Pagination details (reached last page messages for groups/streams)
- Schedule syncing and viewing operations
- Channel database reloading in fuzzy matcher

These changes ensure that:
- INFO level shows only user-facing events and important state changes
- DEBUG level contains detailed operational and internal information
- Logs are consistent across all actions (preview_changes, add_streams, etc.)
- Cleaner log output for production use while maintaining debuggability

Benefits:
- Reduced log noise in production environments
- Easier troubleshooting with DEBUG level when needed
- Consistent logging patterns across the entire codebase
- Better separation between user-facing and internal operations
2025-11-28 17:54:15 +00:00
Claude
1a2f176587 Refactor: Improve logging levels and add channel group statistics
Changes to logging levels:
- Changed fuzzy_matcher channel database loading logs to DEBUG level
- Changed plugin validation and API authentication logs to DEBUG level
- Changed notification sending log to DEBUG level
- Changed per-file channel loading log to DEBUG level

Enhanced INFO logs:
- Updated total channels loaded log to include database names
- Added channel group statistics logging showing:
  * Total number of groups processed
  * For each group: name, channel count, and matched stream count
  * Shows first 10 groups with summary for remaining groups

Benefits:
- Cleaner INFO logs show only essential information
- Detailed debugging information available at DEBUG level
- Better visibility into channel group processing and stream matching
- Easier troubleshooting with group-level statistics
2025-11-28 17:49:15 +00:00
Claude
ef1f4f60db Fix: Always reload channels on preview/add actions to prevent stale data
Changes:
- Modified preview_changes_action to always reload channels before previewing
- Modified add_streams_to_channels_action to always reload channels before adding streams
- Removed file existence check that prevented reload when data was stale
- This ensures deleted channels (like ES DAZN 09/10) won't cause warnings

The processed data file is now refreshed on every preview/add operation,
ensuring users always work with current channel data from the Dispatcharr API.
2025-11-28 17:38:46 +00:00
Pirates IRC
7ab80721f9 Delete test_fuzzy_matcher_fix.py 2025-11-28 11:06:18 -06:00
Pirates IRC
ac92038083 Merge pull request #18 from PiratesIRC/claude/debug-errors-01VkfCYGtyKBfWLL81bppBGd
Debug and identify error issues
2025-11-28 11:05:23 -06:00