Skip to content

Commit 67098e4

Browse files
committed
chore: Update SchedulesDirect to use correct naming convention
1 parent 4f9c7b8 commit 67098e4

File tree

10 files changed

+70
-70
lines changed

10 files changed

+70
-70
lines changed

app/Console/Commands/RefreshEpgSchedulesDirectData.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class RefreshEpgSchedulesDirectData extends Command
2020
*
2121
* @var string
2222
*/
23-
protected $description = 'Refresh Schedules Direct data for a specific EPG. Use force flag to force refresh regardless of last modified time.';
23+
protected $description = 'Refresh SchedulesDirect data for a specific EPG. Use force flag to force refresh regardless of last modified time.';
2424

2525
/**
2626
* Execute the console command.
@@ -29,19 +29,19 @@ public function handle()
2929
{
3030
$epgId = $this->argument('epg');
3131
$force = $this->argument('force') ?? false;
32-
$this->info("Refreshing Schedules Direct data for EPG with ID: {$epgId}, force: ".($force ? 'true' : 'false'));
32+
$this->info("Refreshing SchedulesDirect data for EPG with ID: {$epgId}, force: ".($force ? 'true' : 'false'));
3333
$epg = Epg::where([
3434
['source_type', 'schedules_direct'],
3535
['id', $epgId],
3636
])->first();
3737

3838
if (! $epg) {
39-
$this->error("EPG with ID {$epgId} not found or not a Schedules Direct EPG.");
39+
$this->error("EPG with ID {$epgId} not found or not a SchedulesDirect EPG.");
4040

4141
return;
4242
}
4343
dispatch(new ProcessEpgSDImport(epg: $epg, force: $force));
44-
$this->info('Dispatched Schedules Direct sync job for EPG ID: '.$epgId);
44+
$this->info('Dispatched SchedulesDirect sync job for EPG ID: '.$epgId);
4545

4646
}
4747
}

app/Console/Commands/TestSchedulesDirectCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class TestSchedulesDirectCommand extends Command
1313

1414
protected $signature = 'app:schedules-direct-test {--epg=} {--username=} {--password=} {--country=USA} {--postal_code=60030} {--metadata}';
1515

16-
protected $description = 'Test Schedules Direct API connection and metadata endpoints';
16+
protected $description = 'Test SchedulesDirect API connection and metadata endpoints';
1717

1818
public function handle(SchedulesDirectService $service): int
1919
{
@@ -31,7 +31,7 @@ public function handle(SchedulesDirectService $service): int
3131
}
3232

3333
if (! $epg->sd_username || ! $epg->sd_password) {
34-
$this->error("EPG {$epgId} does not have Schedules Direct credentials configured");
34+
$this->error("EPG {$epgId} does not have SchedulesDirect credentials configured");
3535

3636
return Command::FAILURE;
3737
}
@@ -50,12 +50,12 @@ public function handle(SchedulesDirectService $service): int
5050
->get();
5151

5252
if ($epgs->isEmpty()) {
53-
$this->error('No EPGs with Schedules Direct credentials found. Use --username and --password options or configure an EPG first.');
53+
$this->error('No EPGs with SchedulesDirect credentials found. Use --username and --password options or configure an EPG first.');
5454

5555
return Command::FAILURE;
5656
}
5757

58-
$this->info('Available EPGs with Schedules Direct credentials:');
58+
$this->info('Available EPGs with SchedulesDirect credentials:');
5959
foreach ($epgs as $epg) {
6060
$this->info(" [{$epg->id}] {$epg->name} ({$epg->sd_username})");
6161
}
@@ -88,7 +88,7 @@ public function handle(SchedulesDirectService $service): int
8888
$this->testMetadataEndpoints($token);
8989
}
9090

91-
$this->info("\nSchedules Direct API test completed successfully");
91+
$this->info("\nSchedulesDirect API test completed successfully");
9292

9393
return Command::SUCCESS;
9494
} catch (\Exception $e) {

app/Enums/EpgSourceType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function label(): string
1111
{
1212
return match ($this) {
1313
self::URL => 'URL/XML File',
14-
self::SCHEDULES_DIRECT => 'Schedules Direct',
14+
self::SCHEDULES_DIRECT => 'SchedulesDirect',
1515
};
1616
}
1717
}

app/Filament/Resources/Epgs/EpgResource.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public static function table(Table $table): Table
120120
->toggleable(),
121121
ProgressColumn::make('sd_progress')
122122
->label('SD Progress')
123-
->tooltip('Progress of Schedules Direct import (if using)')
123+
->tooltip('Progress of SchedulesDirect import (if using)')
124124
->sortable()
125125
->poll(fn ($record) => $record->status === Status::Processing || $record->status === Status::Pending ? '3s' : null)
126126
->toggleable(),
@@ -348,7 +348,7 @@ public static function getForm(): array
348348
->grouped()
349349
->options([
350350
'url' => 'File, URL or Path',
351-
'schedules_direct' => 'Schedules Direct',
351+
'schedules_direct' => 'SchedulesDirect',
352352
])
353353
->icons([
354354
'url' => 'heroicon-s-link',
@@ -357,14 +357,14 @@ public static function getForm(): array
357357
->default('url')
358358
->live()
359359
->hiddenOn('edit')
360-
->helperText('Choose between URL/file upload or Schedules Direct integration'),
360+
->helperText('Choose between URL/file upload or SchedulesDirect integration'),
361361

362-
// Schedules Direct Configuration
363-
Section::make('Schedules Direct Configuration')
364-
->description('Configure your Schedules Direct account settings')
362+
// SchedulesDirect Configuration
363+
Section::make('SchedulesDirect Configuration')
364+
->description('Configure your SchedulesDirect account settings')
365365
->headerActions([
366-
Action::make('Schedules Direct')
367-
->label('Schedules Direct')
366+
Action::make('SchedulesDirect')
367+
->label('SchedulesDirect')
368368
->icon('heroicon-o-arrow-top-right-on-square')
369369
->iconPosition('after')
370370
->size('sm')
@@ -427,7 +427,7 @@ public static function getForm(): array
427427
->schema([
428428
Select::make('sd_lineup_id')
429429
->label('Lineup')
430-
->helperText('Select your Schedules Direct lineup')
430+
->helperText('Select your SchedulesDirect lineup')
431431
->searchable()
432432
->getSearchResultsUsing(function (string $search, Get $get, SchedulesDirectService $service) {
433433
$country = $get('sd_country');
@@ -514,7 +514,7 @@ public static function getForm(): array
514514
->default(3)
515515
->minValue(1)
516516
->maxValue(14)
517-
->helperText('Number of days to import from Schedules Direct (1-14)')
517+
->helperText('Number of days to import from SchedulesDirect (1-14)')
518518
->required(fn (Get $get): bool => $get('source_type') === EpgSourceType::SCHEDULES_DIRECT->value),
519519
Toggle::make('sd_metadata.enabled')
520520
->label('Import Metadata')
@@ -524,7 +524,7 @@ public static function getForm(): array
524524

525525
Toggle::make('sd_debug')
526526
->label('Enable Debugging')
527-
->helperText('This should be false unless directed by SchedulesDirect support')
527+
->helperText('This should be disabled unless directed by SchedulesDirect support')
528528
->default(false)
529529
->hiddenOn('create')
530530
->visible(fn (Get $get): bool => $get('source_type') === EpgSourceType::SCHEDULES_DIRECT->value),
@@ -649,7 +649,7 @@ public static function getForm(): array
649649
// Notification::make()
650650
// ->success()
651651
// ->title('Lineup added successfully!')
652-
// ->body("Lineup {$lineupId} has been added to your Schedules Direct account")
652+
// ->body("Lineup {$lineupId} has been added to your SchedulesDirect account")
653653
// ->send();
654654
// } catch (\Exception $e) {
655655
// Notification::make()

app/Http/Controllers/EpgFileController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __invoke(string $uuid)
2020
$filePath = $epg->url;
2121
} else {
2222
// Finally, fallback to the generated file path
23-
// This will be for EPGs generated via Schedules Direct
23+
// This will be for EPGs generated via SchedulesDirect
2424
$filePath = Storage::disk('local')->path($epg->file_path);
2525
}
2626
if (! ($filePath && file_exists($filePath))) {

app/Http/Controllers/SchedulesDirectImageProxyController.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function __construct(
1616
) {}
1717

1818
/**
19-
* Proxy Schedules Direct program images with authentication
19+
* Proxy SchedulesDirect program images with authentication
2020
*
2121
* Route: /schedules-direct/{epg}/image/{imageHash}
2222
*/
@@ -29,9 +29,9 @@ public function proxyImage(Request $request, string $epgId, string $imageHash)
2929
return response()->json(['error' => 'EPG not found'], 404);
3030
}
3131

32-
// Validate that this EPG uses Schedules Direct
32+
// Validate that this EPG uses SchedulesDirect
3333
if (! $epg->isSchedulesDirect()) {
34-
return response()->json(['error' => 'EPG does not use Schedules Direct'], 400);
34+
return response()->json(['error' => 'EPG does not use SchedulesDirect'], 400);
3535
}
3636

3737
// Create cache key for this image
@@ -49,7 +49,7 @@ public function proxyImage(Request $request, string $epgId, string $imageHash)
4949
$epg->refresh();
5050
}
5151

52-
// Build the Schedules Direct image URL
52+
// Build the SchedulesDirect image URL
5353
$imageUrl = "https://json.schedulesdirect.org/20141201/image/{$imageHash}";
5454

5555
// Fetch the image with authentication
@@ -76,7 +76,7 @@ public function proxyImage(Request $request, string $epgId, string $imageHash)
7676
'headers' => $headers,
7777
], now()->addHours(24));
7878

79-
Log::debug('Successfully proxied Schedules Direct image', [
79+
Log::debug('Successfully proxied SchedulesDirect image', [
8080
'epg_id' => $epgId,
8181
'image_hash' => $imageHash,
8282
'content_type' => $contentType,
@@ -85,20 +85,20 @@ public function proxyImage(Request $request, string $epgId, string $imageHash)
8585

8686
return response($body, 200, $headers);
8787
} else {
88-
Log::warning('Failed to fetch Schedules Direct image', [
88+
Log::warning('Failed to fetch SchedulesDirect image', [
8989
'epg_id' => $epgId,
9090
'image_hash' => $imageHash,
9191
'status' => $response->status(),
9292
'response' => $response->body(),
9393
]);
9494

9595
return response()->json([
96-
'error' => 'Failed to fetch image from Schedules Direct',
96+
'error' => 'Failed to fetch image from SchedulesDirect',
9797
'status' => $response->status(),
9898
], $response->status());
9999
}
100100
} catch (\Exception $e) {
101-
Log::error('Exception in Schedules Direct image proxy', [
101+
Log::error('Exception in SchedulesDirect image proxy', [
102102
'epg_id' => $epgId,
103103
'image_hash' => $imageHash,
104104
'error' => $e->getMessage(),

app/Jobs/ProcessEpgImport.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function handle(SchedulesDirectService $service): void
117117
logger()->error("Error processing \"{$this->epg->name}\"");
118118

119119
// Send notification
120-
$error = 'Invalid Schedules Direct credentials. Unable to get results from the API. Please check the credentials and try again.';
120+
$error = 'Invalid SchedulesDirect credentials. Unable to get results from the API. Please check the credentials and try again.';
121121
Notification::make()
122122
->danger()
123123
->title("Error processing \"{$this->epg->name}\"")
@@ -145,12 +145,12 @@ public function handle(SchedulesDirectService $service): void
145145

146146
return;
147147
} else {
148-
// Sync the EPG data from Schedules Direct
148+
// Sync the EPG data from SchedulesDirect
149149
// Notify user we're starting the sync...
150150
Notification::make()
151151
->info()
152-
->title('Starting Schedules Direct Data Sync')
153-
->body("Schedules Direct Data Sync started for EPG \"{$epg->name}\".")
152+
->title('Starting SchedulesDirect Data Sync')
153+
->body("SchedulesDirect Data Sync started for EPG \"{$epg->name}\".")
154154
->broadcast($epg->user)
155155
->sendToDatabase($epg->user);
156156

@@ -180,8 +180,8 @@ public function handle(SchedulesDirectService $service): void
180180
// Notify user of success
181181
Notification::make()
182182
->success()
183-
->title('Schedules Direct Data Synced')
184-
->body("Schedules Direct Data Synced successfully for EPG \"{$epg->name}\". Completed in {$completedInRounded} seconds. Now parsing data and generating EPG cache...")
183+
->title('SchedulesDirect Data Synced')
184+
->body("SchedulesDirect Data Synced successfully for EPG \"{$epg->name}\". Completed in {$completedInRounded} seconds. Now parsing data and generating EPG cache...")
185185
->broadcast($epg->user)
186186
->sendToDatabase($epg->user);
187187

app/Jobs/ProcessEpgSDImport.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public function handle(SchedulesDirectService $service): bool
4444
// Notify user we're starting the sync...
4545
Notification::make()
4646
->info()
47-
->title('Starting Schedules Direct Data Sync')
48-
->body("Schedules Direct Data Sync started for EPG \"{$epg->name}\".")
47+
->title('Starting SchedulesDirect Data Sync')
48+
->body("SchedulesDirect Data Sync started for EPG \"{$epg->name}\".")
4949
->broadcast($epg->user)
5050
->sendToDatabase($epg->user);
5151

@@ -75,26 +75,26 @@ public function handle(SchedulesDirectService $service): bool
7575
// Notify user of success
7676
Notification::make()
7777
->success()
78-
->title('Schedules Direct Data Synced')
79-
->body("Schedules Direct Data Synced successfully for EPG \"{$epg->name}\". Completed in {$completedInRounded} seconds. Now parsing data and generating EPG cache...")
78+
->title('SchedulesDirect Data Synced')
79+
->body("SchedulesDirect Data Synced successfully for EPG \"{$epg->name}\". Completed in {$completedInRounded} seconds. Now parsing data and generating EPG cache...")
8080
->broadcast($epg->user)
8181
->sendToDatabase($epg->user);
8282

8383
return true;
8484
} catch (Exception $e) {
8585
// Log the exception
86-
logger()->error("Error processing Schedules Direct Data for EPG \"{$this->epg->name}\"");
86+
logger()->error("Error processing SchedulesDirect Data for EPG \"{$this->epg->name}\"");
8787

8888
// Send notification
8989
$error = 'Error: '.$e->getMessage();
9090
Notification::make()
9191
->danger()
92-
->title("Error processing Schedules Direct Data for EPG \"{$this->epg->name}\"")
92+
->title("Error processing SchedulesDirect Data for EPG \"{$this->epg->name}\"")
9393
->body('Please view your notifications for details.')
9494
->broadcast($this->epg->user);
9595
Notification::make()
9696
->danger()
97-
->title("Error processing Schedules Direct Data for EPG \"{$this->epg->name}\"")
97+
->title("Error processing SchedulesDirect Data for EPG \"{$this->epg->name}\"")
9898
->body($error)
9999
->sendToDatabase($this->epg->user);
100100
}

app/Providers/AppServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private function configureDynamicHttpsDetection(): void
150150
* Configure a sensible base URL for console/CLI contexts where there is
151151
* no incoming HTTP request. This ensures that route() and url() include
152152
* the correct host and port when generating absolute URLs (e.g. for
153-
* Schedules Direct artwork proxies written into EPG files).
153+
* SchedulesDirect artwork proxies written into EPG files).
154154
*/
155155
private function configureConsoleBaseUrl(): void
156156
{

0 commit comments

Comments
 (0)