Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/mintopia/musicparty into…
Browse files Browse the repository at this point in the history
… develop
  • Loading branch information
mintopia committed Dec 30, 2024
2 parents de14d54 + 8620ae7 commit c710732
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/Http/Controllers/Webhooks/PartyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,11 @@ public function librespot(PartyLibrespotRequest $request, Party $party)
}
return response()->noContent();
}

public function simple(Party $party)
{
Log::debug("{$party}: Received simple webhook event");
PartyUpdate::dispatch($party)->onQueue('partyupdates')->afterResponse();
return response()->noContent();
}
}
3 changes: 3 additions & 0 deletions app/Models/Party.php
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,9 @@ protected function backfillUpcomingSongs()
->toArray();

$tracks = array_filter($tracks, function ($track) use ($existingIds) {
if ($track->track === null) {
return false;
}
return !in_array($track->track->id, $existingIds);
});

Expand Down
1 change: 1 addition & 0 deletions routes/webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

Route::name('webhooks.')->middleware('auth:sanctum')->group(function () {
Route::post('parties/{party}/librespot', [PartyController::class, 'librespot'])->middleware('can:update,party')->name('parties.update');
Route::post('parties/{party}/simple', [PartyController::class, 'simple'])->middleware('can:update,party')->name('parties.simple');
});

0 comments on commit c710732

Please sign in to comment.