Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
- Livewire select user dropdown hidden input form validation
- Don't show clapters wth clips without assets in series page

Signed-off-by: Stefanos Georgopoulos <[email protected]>
  • Loading branch information
stefanosgeo committed Feb 3, 2025
1 parent 7ada169 commit 69ae224
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 72 deletions.
8 changes: 5 additions & 3 deletions app/Livewire/ListSeriesClips.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function render(): Application|Factory|View|\Illuminate\View\View
$search = trim(Str::lower($this->search));
$series = $this->series;
$clips = $this->queryClips($search)->get();

$chapterIDs = $clips->pluck('chapter_id')
->unique()
->reject(function ($value) {
Expand Down Expand Up @@ -105,10 +106,11 @@ protected function queryClips($search)
if (! auth()->check() || auth()->user()->cannot('edit-series', $this->series)) {
$query->Public()
->where(function (Builder $query) {
$query->has('assets')
->orWhere('recording_date', '<', Carbon::yesterday())
->orWhere('is_livestream', true);
$query->whereHas('assets') // Must have assets
->orwhere('recording_date', '<', Carbon::yesterday())
->orWhere('is_livestream', true); // Both conditions required
});

}

return $this->applySearchFilter($query, $search)->orderBy('episode', 'asc');
Expand Down
Loading

0 comments on commit 69ae224

Please sign in to comment.