feat: auto-merge channels on custom playlists - #1275
Open
tjelite1986 wants to merge 1 commit into
Open
Conversation
Adds the playlist auto-merge capability to custom playlists (issue m3ue#1103), restricted to the channels actually attached to the custom playlist so overlapping providers can be merged only where they coexist in the curated lineup — optionally filtered to selected custom groups. - MergeChannels gains optional customPlaylistId/customGroupNames scoping applied to all three candidate queries (stream-id, name-fallback, regex); custom-context merges never fall back to the source playlist's regex config - SyncListener::getCustomPlaylistMergeJob builds the job from the new auto_merge_config on custom playlists, deriving the master-priority playlist order from the config or from the custom playlist's source playlists - Merge is chained before the existing processing rules (sort/recount) after each custom playlist auto-sync; AutoSyncGroupsToCustomPlaylist now fires SyncCompleted when auto-merge is enabled - New Auto-Merge Channels section in the custom playlist Processing tab (group scope, preferred playlist, source priority, regex patterns, merge key, resolution/catchup/re-merge/deactivate toggles) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #1103: custom playlists get the same auto-merge capability as regular playlists, with merge candidates restricted to the channels attached to the custom playlist — optionally narrowed further to selected custom playlist groups. This directly addresses the issue's pain point: merging two overlapping providers only where they coexist in the curated custom playlist ("merged on a group basis"), instead of merging one playlist wholesale into the other.
How it works
Auto-Merge Channelssection in the custom playlist's Processing tab: enable toggle, custom-group scope, preferred playlist, ordered source-playlist priority, regex patterns, merge key (stream ID / TMDB ID), and the resolution / catchup / force-re-merge / deactivate-failover toggles.MergeChannelsgains optionalcustomPlaylistId/customGroupNamesscoping, applied to all three candidate queries (stream-id pass, name-fallback pass, regex pass). Group scoping uses the custom playlist's tag groups (same mechanism as the existing Processing Configs). Custom-context merges never fall back to the primary source playlist's ownregex_patternsconfig.SyncListener::getCustomPlaylistMergeJob()mirrorsgetMergeJob(): master priority comes from the configured playlist order, falling back to the distinct source playlists of the custom playlist's channels;buildWeightedConfigand the name-fallback config builder are reused as-is.AutoSyncGroupsToCustomPlaylistnow firesSyncCompletedwhen auto-merge is enabled (previously only when processing rules existed).Advanced priority scoring (group priorities / priority attributes / keywords) still works through the shared
buildWeightedConfig, but I intentionally left that fieldset out of the custom playlist UI for now to keep the form focused — easy to add if wanted.Test plan
tests/Feature/CustomPlaylistChannelMergeTest.php(6 tests): scope isolation (duplicates outside the custom playlist untouched), custom-group filtering, master selection by configured playlist order, playlist derivation when unconfigured, null-job guards, and the merge→processing chain on sync completion.MergeChannelOrdering|MergeDisabledGroups|RegexMerge|AliasFallbackMerge|AddGroupsToCustomPlaylist|AutoSyncGroupsToCustomPlaylist|ChannelCustomGroup|SyncListener|CustomPlaylistProviderProfile|CustomPlaylistSortOrder→ 115 passed (235 assertions).vendor/bin/pint --dirtyclean.Closes #1103
🤖 Generated with Claude Code