fix(home): update where clause when getting all podcasts to prevent draft podcasts from showing up

This commit is contained in:
Yassine Doghri 2023-08-22 15:00:01 +00:00
parent 11aa3586a0
commit 7a1eea58d3

View File

@ -185,11 +185,13 @@ class PodcastModel extends Model
$fediverseTablePrefix . 'posts.actor_id = podcasts.actor_id', $fediverseTablePrefix . 'posts.actor_id = podcasts.actor_id',
'left' 'left'
) )
->groupStart()
->where( ->where(
'`' . $fediverseTablePrefix . 'posts`.`published_at` <= UTC_TIMESTAMP()', '`' . $fediverseTablePrefix . 'posts`.`published_at` <= UTC_TIMESTAMP()',
null, null,
false false
)->orWhere($fediverseTablePrefix . 'posts.published_at', null) )->orWhere($fediverseTablePrefix . 'posts.published_at', null)
->groupEnd()
->groupBy('podcasts.actor_id') ->groupBy('podcasts.actor_id')
->orderBy('max_published_at', 'DESC'); ->orderBy('max_published_at', 'DESC');
} elseif ($orderBy === 'created_desc') { } elseif ($orderBy === 'created_desc') {