Skip to content

Commit 6ab1bf1

Browse files
committed
fix: Make sure we're passing Playlist to Xtream service for profile reconcile
Need to make sure we're passing user agent and other variables for profile reconcile from the parent playlist
1 parent 1040be2 commit 6ab1bf1

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

app/Services/ProfileService.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,11 @@ public static function refreshProfile(PlaylistProfile $profile): bool
377377
return false;
378378
}
379379

380-
$xtream = XtreamService::make(xtream_config: $xtreamConfig);
380+
// Pass playlist for context (passes user agent, ssl settings, etc.)
381+
$xtream = XtreamService::make(
382+
playlist: $profile->playlist,
383+
xtream_config: $xtreamConfig
384+
);
381385

382386
if (! $xtream) {
383387
Log::warning("Cannot refresh profile {$profile->id}: failed to create XtreamService");

app/Services/XtreamService.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,16 @@ public function init(
6060
$this->xtream_config = $xtream_config;
6161

6262
// Setup server, user, and pass
63-
if ($playlist) {
63+
// Prefer Xtream config if provided directly
64+
if ($xtream_config) {
65+
$this->server = $xtream_config['url'] ?? '';
66+
$this->user = $xtream_config['username'] ?? '';
67+
$this->pass = $xtream_config['password'] ?? '';
68+
} elseif ($playlist) {
6469
$config = $playlist->xtream_config;
6570
$this->server = $config['url'] ?? '';
6671
$this->user = $config['username'] ?? '';
6772
$this->pass = $config['password'] ?? '';
68-
} elseif ($xtream_config) {
69-
$this->server = $xtream_config['url'] ?? '';
70-
$this->user = $xtream_config['username'] ?? '';
71-
$this->pass = $xtream_config['password'] ?? '';
7273
} else {
7374
return false;
7475
}

0 commit comments

Comments
 (0)