Skip to content

Commit f9f28d6

Browse files
committed
Add playlist and epg reset to queue reset action; rollback m3u processing change
1 parent 6843052 commit f9f28d6

21 files changed

+535
-124
lines changed

app/Filament/Pages/CustomDashboard.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function getActions(): array
2323
Notification::make()
2424
->success()
2525
->title('Queue reset')
26-
->body('The queue workers have been restarted and any pending jobs flushed. You may need to reset the status of your Playlist or EPG if it\'s stuck in a "Processing" state.')
26+
->body('The queue workers have been restarted and any pending jobs flushed. You may need to manually sync any Playlists or EPGs that were in progress.')
2727
->duration(10000)
2828
->send();
2929
})
@@ -32,8 +32,8 @@ protected function getActions(): array
3232
->requiresConfirmation()
3333
->icon('heroicon-o-exclamation-triangle')
3434
->modalIcon('heroicon-o-exclamation-triangle')
35-
->modalDescription('Resetting the queue will restart the queue workers and flush any pending jobs. You may need to reset the status of your Playlist or EPG if it\'s stuck in a "Processing" state.')
36-
->modalSubmitActionLabel('Yes, reset now')
35+
->modalDescription('Resetting the queue will restart the queue workers and flush any pending jobs. Any syncs or background processes will be stopped and removed. Only perform this action if you are having sync issues.')
36+
->modalSubmitActionLabel('I understand, reset now')
3737
];
3838
}
3939
}

app/Filament/Pages/Preferences.php

-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ public function form(Form $form): Form
3030
'left' => 'Left',
3131
'top' => 'Top',
3232
]),
33-
Forms\Components\Toggle::make('show_jobs_navigation')
34-
->label('Show jobs navigation')
35-
->helperText('View jobs and job status for background tasks'),
3633
Forms\Components\Toggle::make('show_breadcrumbs')
3734
->label('Show breadcrumbs')
3835
->helperText('Show breadcrumbs under the page titles'),

app/Filament/Resources/QueueMonitorResource.php

-13
This file was deleted.

app/Jobs/RestartQueue.php

+38
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
namespace App\Jobs;
44

5+
use App\Enums\EpgStatus;
6+
use App\Enums\PlaylistStatus;
7+
use App\Models\Epg;
8+
use App\Models\EpgMap;
9+
use App\Models\Playlist;
510
use Illuminate\Contracts\Queue\ShouldQueue;
611
use Illuminate\Foundation\Queue\Queueable;
712
use Illuminate\Support\Facades\Artisan;
@@ -24,7 +29,40 @@ public function __construct()
2429
public function handle(): void
2530
{
2631
try {
32+
// Restart the queue and flush any pending jobs
2733
Artisan::call('app:restart-queue');
34+
35+
// Reset Playlist and EPGs that were in a processing state
36+
Playlist::where('status', PlaylistStatus::Processing)
37+
->orWhere('processing', true)
38+
->update([
39+
'status' => PlaylistStatus::Pending,
40+
'processing' => false,
41+
'progress' => 0,
42+
'channels' => 0,
43+
'synced' => null,
44+
'errors' => null,
45+
]);
46+
Epg::where('status', EpgStatus::Processing)
47+
->orWhere('processing', true)
48+
->update([
49+
'status' => EpgStatus::Pending,
50+
'processing' => false,
51+
'progress' => 0,
52+
'synced' => null,
53+
'errors' => null,
54+
]);
55+
56+
// Update EPG Maps
57+
EpgMap::where('status', EpgStatus::Processing)
58+
->orWhere('processing', true)
59+
->update([
60+
'status' => EpgStatus::Failed,
61+
'processing' => false,
62+
'progress' => 0,
63+
'synced' => null,
64+
'errors' => 'The EPG mapping process was interrupted and has been marked as failed.',
65+
]);
2866
} catch (\Exception $e) {
2967
// Ignore
3068
}

app/Providers/Filament/AdminPanelProvider.php

-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use Illuminate\Session\Middleware\StartSession;
2525
use Illuminate\Support\Facades\Blade;
2626
use Illuminate\View\Middleware\ShareErrorsFromSession;
27-
use \Croustibat\FilamentJobsMonitor\FilamentJobsMonitorPlugin;
2827
use Filament\Support\Enums\MaxWidth;
2928
use Hydrat\TableLayoutToggle\TableLayoutTogglePlugin;
3029
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
@@ -85,8 +84,6 @@ public function panel(Panel $panel): Panel
8584
DiscordWidget::class,
8685
])
8786
->plugins([
88-
FilamentJobsMonitorPlugin::make()
89-
->enableNavigation($settings['show_jobs_navigation'] ?? false),
9087
TableLayoutTogglePlugin::make(),
9188
EasyFooterPlugin::make()
9289
->withBorder()

app/Providers/HorizonServiceProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function boot(): void
2828
protected function gate(): void
2929
{
3030
Gate::define('viewHorizon', function ($user) {
31-
return app()->environment('local');
31+
return true;
3232
});
3333
}
3434
}

app/Settings/GeneralSettings.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class GeneralSettings extends Settings
99
{
1010
public ?string $navigation_position = 'left';
1111
public ?bool $show_breadcrumbs = true;
12-
public ?bool $show_jobs_navigation = false;
1312
public ?string $content_width = MaxWidth::ScreenExtraLarge->value;
1413

1514
public ?string $playlist_agent_string = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13';

composer.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
"name": "laravel/laravel",
44
"type": "project",
55
"description": "The skeleton application for the Laravel framework.",
6-
"keywords": ["laravel", "framework"],
6+
"keywords": [
7+
"laravel",
8+
"framework"
9+
],
710
"license": "MIT",
811
"require": {
912
"php": "^8.2",
10-
"croustibat/filament-jobs-monitor": "^2.5",
1113
"devonab/filament-easy-footer": "^1.0",
1214
"dragonmantank/cron-expression": "^3.4",
1315
"filament/filament": "^3.2",
@@ -18,6 +20,7 @@
1820
"laravel/octane": "^2.6",
1921
"laravel/reverb": "^1.0",
2022
"laravel/tinker": "^2.9",
23+
"opcodesio/log-viewer": "^3.15",
2124
"predis/predis": "^2.3",
2225
"ryangjchandler/filament-progress-column": "^1.0",
2326
"sparkison/m3u-parser": "dev-master",

0 commit comments

Comments
 (0)