mirror of
https://code.castopod.org/adaures/castopod
synced 2025-04-19 13:01:19 +00:00
fix: sort episodes by published_at with unpublished episodes at the begining
set the right permissions for episode's publication date edit fixes #249
This commit is contained in:
parent
d0836f3ee3
commit
1686f840d1
@ -333,7 +333,7 @@ $routes->group(
|
||||
[
|
||||
'as' => 'episode-publish_date_edit',
|
||||
'filter' =>
|
||||
'permission:podcast-manage_publications',
|
||||
'permission:podcast#.episodes.manage-publications',
|
||||
],
|
||||
);
|
||||
$routes->post(
|
||||
@ -341,7 +341,7 @@ $routes->group(
|
||||
'EpisodeController::attemptPublishDateEdit/$1/$2',
|
||||
[
|
||||
'filter' =>
|
||||
'permission:podcast-manage_publications',
|
||||
'permission:podcast#.episodes.manage-publications',
|
||||
],
|
||||
);
|
||||
$routes->get(
|
||||
|
@ -74,6 +74,7 @@ class EpisodeController extends BaseController
|
||||
->where('podcast_id', $this->podcast->id)
|
||||
->like('title', $query)
|
||||
->orLike('description_markdown', $query)
|
||||
->orderBy('-`published_at`', '', false)
|
||||
->orderBy('created_at', 'desc');
|
||||
} else {
|
||||
$episodes = (new EpisodeModel())
|
||||
@ -83,6 +84,7 @@ class EpisodeController extends BaseController
|
||||
} else {
|
||||
$episodes = (new EpisodeModel())
|
||||
->where('podcast_id', $this->podcast->id)
|
||||
->orderBy('-`published_at`', '', false)
|
||||
->orderBy('created_at', 'desc');
|
||||
}
|
||||
|
||||
|
@ -422,6 +422,7 @@ class PodcastController extends BaseController
|
||||
{
|
||||
$episodes = (new EpisodeModel())
|
||||
->where('podcast_id', $podcastId)
|
||||
->orderBy('-`published_at`', '', false)
|
||||
->orderBy('created_at', 'desc')
|
||||
->findAll($limit);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user