mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-03 23:09:18 +02:00
fix(podcast-import): show cancel or retry action depending on task status
This commit is contained in:
parent
06c4f15477
commit
e42258de1f
3 changed files with 37 additions and 24 deletions
|
|
@ -145,11 +145,17 @@ class PodcastImportController extends BaseController
|
|||
$importTask = $importQueue[$taskId];
|
||||
switch ($action) {
|
||||
case 'cancel':
|
||||
$importTask->cancel();
|
||||
if ($importTask->status === TaskStatus::Running || $importTask->status === TaskStatus::Queued) {
|
||||
$importTask->cancel();
|
||||
|
||||
return redirect()->back()
|
||||
->with('message', lang('PodcastImport.messages.canceled'));
|
||||
}
|
||||
|
||||
return redirect()->back()
|
||||
->with('message', lang('PodcastImport.messages.canceled'));
|
||||
->with('error', lang('PodcastImport.messages.notRunning'));
|
||||
case 'retry':
|
||||
if ($importTask->status === TaskStatus::Running) {
|
||||
if ($importTask->status === TaskStatus::Running || $importTask->status === TaskStatus::Queued) {
|
||||
return redirect()->back()
|
||||
->with('error', lang('PodcastImport.messages.alreadyRunning'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue