mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-23 19:50:40 -05:00
fix: torrent search playlist filter
We need to filter the given columns on the `playlists` table, not the `playlist_torrent` table.
This commit is contained in:
@@ -240,10 +240,12 @@ trait TorrentFilter
|
||||
->where('playlist_id', '=', $playlistId)
|
||||
->when(
|
||||
$authenticatedUser === null,
|
||||
fn ($query) => $query->where('is_private', '=', false),
|
||||
fn ($query) => $query->whereRelation('playlist', 'is_private', '=', false),
|
||||
fn ($query) => $query->when(
|
||||
! $authenticatedUser->group->is_modo,
|
||||
fn ($query) => $query->where(fn ($query) => $query->where('is_private', '=', false)->orWhere('user_id', '=', $authenticatedUser->id))
|
||||
fn ($query) => $query->where(fn ($query) => $query
|
||||
->whereRelation('playlist', 'is_private', '=', false)
|
||||
->orWhereRelation('playlist', 'user_id', '=', $authenticatedUser->id))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user