Skip to content

Commit

Permalink
Fix weighted playback
Browse files Browse the repository at this point in the history
  • Loading branch information
mintopia committed Dec 31, 2024
1 parent 64aefd2 commit 738585e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/V1/SongRatingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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,
]);
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Party.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 738585e

Please sign in to comment.