diff --git a/app/Http/Controllers/Api/V1/SongRatingController.php b/app/Http/Controllers/Api/V1/SongRatingController.php index 84af7ec..a57f267 100644 --- a/app/Http/Controllers/Api/V1/SongRatingController.php +++ b/app/Http/Controllers/Api/V1/SongRatingController.php @@ -4,7 +4,7 @@ use App\Http\Controllers\Controller; use App\Http\Requests\Api\V1\SongRatingRequest; -use App\Http\Resources\V1\SongRatingResource; +use App\Http\Resources\V1\UpcomingSongResource; use App\Models\Party; use App\Models\PlayedSong; @@ -23,7 +23,7 @@ public function store(SongRatingRequest $request, Party $party, PlayedSong $play $rating = null; } } - $resource = new SongRatingResource($playedsong); + $resource = new UpcomingSongResource($playedsong); $resource->augment((object)[ 'rating' => $rating, ]); diff --git a/app/Models/Party.php b/app/Models/Party.php index 4738a56..77a50a0 100644 --- a/app/Models/Party.php +++ b/app/Models/Party.php @@ -404,7 +404,7 @@ protected function syncPlaylist(object $playlist) } } } - $remaining = $toAdd = $songsToAdd->count(); + $remaining = $toAdd - $songsToAdd->count(); if ($remaining > 0) { // Didn't add enough songs, try and find *any* using old method