Skip to content

Commit 70e063f

Browse files
committed
fix: Merge preference
Resolves #725
1 parent db139a5 commit 70e063f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/Jobs/MergeChannels.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,14 @@ protected function filterDisabledGroups($group)
227227
*/
228228
protected function selectMasterByWeightedScore($group, array $playlistPriority)
229229
{
230+
// Enforce prefer catch-up as primary if enabled
231+
if ($this->preferCatchupAsPrimary) {
232+
$catchupChannels = $group->filter(fn ($channel) => ! empty($channel->catchup));
233+
if ($catchupChannels->isNotEmpty()) {
234+
$group = $catchupChannels;
235+
}
236+
}
237+
230238
$scoredChannels = $group->map(function ($channel) use ($playlistPriority) {
231239
return [
232240
'channel' => $channel,

0 commit comments

Comments
 (0)