Skip to content

Commit

Permalink
Merge pull request #3853 from LostRager/patch-5
Browse files Browse the repository at this point in the history
(Fix) genres for games and collection array error
  • Loading branch information
HDVinnie authored May 22, 2024
2 parents af49785 + 9224f79 commit c93622b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Traits/TorrentMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function scopeMeta($torrents): \Illuminate\Pagination\LengthAwarePaginato
$games = [];

foreach ($gameIds as $gameId) {
$games[$gameId] = Game::with(['cover' => ['url', 'image_id']])->find($gameId);
$games[$gameId] = Game::with(['cover' => ['url', 'image_id'], 'genres' => ['name']])->find($gameId);
}

return $torrents->map(function ($torrent) use ($movies, $tv, $games) {
Expand Down
2 changes: 1 addition & 1 deletion resources/views/torrent/partials/game_meta.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class="{{ config('other.font-awesome') }} fa-theater-masks meta-chip__icon"
></i>
<h2 class="meta-chip__name">Genres</h2>
<h3 class="meta-chip__value">
{{ implode(' / ', array_map(fn ($genre) => $genre['name'], $meta->genres)) }}
{{ implode(' / ', array_map(fn ($genre) => $genre['name'], $meta->genres->toArray())) }}
</h3>
</article>
@endif
Expand Down

0 comments on commit c93622b

Please sign in to comment.