Skip to content

Commit 183bc78

Browse files
committed
Fix: Remove old Archive.org references in FetchLibriVoxAudiobooks command
1 parent 6b496dd commit 183bc78

File tree

6 files changed

+17
-377
lines changed

6 files changed

+17
-377
lines changed

PROGRESS_LOG.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,27 @@ This revised strategy aims to decouple the import process from direct cron job e
3030
* **Security**: The webhook endpoint is secured using a shared secret token (`config('app.import_webhook_token')`).
3131

3232
4. **Queue Worker Configuration (User Action)**:
33-
* **Action Required by User**: Ensure a Laravel queue worker is configured and running persistently on your Forge server. This is typically set up under your Site's "Daemons" or Server's "Daemons" section in Forge. This worker will process the `ImportAudiobookJob` instances.
33+
* **Action Required by User**: Ensure a Laravel queue worker is configured and running persistently on your Forge server. This is typically set up under your Site's "Daemons" or Server's "Daemons" section in Forge. This worker will process the `ImportAudiobookJob` instances. (Completed)
3434

3535
5. **Automation Trigger**:
36-
* Instead of a direct cron job for `librivox:full-import`, an external service (e.g., a free online cron job service, or a simple `curl` command from another server) will make a periodic HTTP POST request to the secure `/api/import/trigger` endpoint. This decouples the import trigger from Forge's potentially problematic scheduler SSH connectivity.
36+
* Instead of a direct cron job for `librivox:full-import`, an external service (e.g., a free online cron job service, or a simple `curl` command from another server) will make a periodic HTTP POST request to the secure `/api/import/trigger` endpoint. This decouples the import trigger from Forge's potentially problematic scheduler SSH connectivity. (Completed: Configured to run every 15 minutes).
3737

3838
6. **Revised Scheduling (Local Change)**:
3939
* **`app/Console/Kernel.php`**: The `librivox:full-import` command is **no longer scheduled directly** in this file. Its execution is now managed by the webhook dispatching jobs. (Completed)
4040

4141
7. **Cleanup of Old Scheduler (User Action)**:
42-
* **Action Required by User**: Delete any manually created `librivox:full-import` schedulers in Laravel Forge to avoid conflicts. The automatically created `php8.3 /home/librostreamcom/librostream.com/artisan schedule:run` cron job should remain active, as it manages other Laravel scheduled tasks (though not the import in this new model).
42+
* **Action Required by User**: Delete any manually created `librivox:full-import` schedulers in Laravel Forge to avoid conflicts. The automatically created `php8.3 /home/librostreamcom/librostream.com/artisan schedule:run` cron job should remain active, as it manages other Laravel scheduled tasks (though not the import in this new model). (Completed)
4343

4444
**Current Status & Resolved Issues:**
4545
* **Images and Layout**: Images are now working correctly on audiobook detail pages, and the "The Librostream Experience" layout issue is resolved.
4646
* **"Märchen (Index aller Märchen) (LibriVox ID: 66)"**: This book still shows "No audio tracks found for sections". User clarified this is an index page on LibriVox that links to other audiobooks, not a directly playable audiobook. (Decision on how to handle this deferred for future discussion).
47-
* **Forge Scheduler Failure**: The persistent SSH connectivity issue for scheduled jobs is being bypassed by this new webhook-triggered approach.
48-
49-
**Next Steps (Requires User Action for Deployment & Full Automation):**
50-
1. **Delete Old Scheduler**: Delete the manually created `librivox:full-import` scheduler in Forge.
51-
2. **Deploy Changes**: Commit and push all local code changes to your Git repository. Laravel Forge will then deploy the updated application.
52-
3. **Configure Queue Worker**: Ensure a Laravel queue worker is running on your Forge server.
53-
4. **Set up External Trigger**: Configure an external service to send periodic POST requests to your new `/api/import/trigger` endpoint with the correct security token.
54-
5. **Verify Live Site**: After deployment and initial trigger, confirm the live site is populating with data.
47+
* **Forge Scheduler Failure**: The persistent SSH connectivity issue for scheduled jobs is being bypassed by this new webhook-triggered approach, which is now fully implemented and configured.
48+
49+
**File and Folder Cleanup (Completed):**
50+
* `app/Console/Commands/FullLibriVoxSectionsImport.php` (Deleted)
51+
* `app/Console/Commands/BackfillAudiobookSlugs.php` (Deleted)
52+
* `TROUBLESHOOTING_LIVE_SERVER.md` (Deleted)
53+
* `app/Console/Commands/FetchAudiobookSections.php` (Deleted)
54+
55+
**Next Steps (Requires User Action for Monitoring):**
56+
1. **Verify Live Site**: Monitor the live site over the next few days to confirm that audiobooks are populating, images are displaying correctly, and all features are working as expected.

TROUBLESHOOTING_LIVE_SERVER.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

app/Console/Commands/BackfillAudiobookSlugs.php

Lines changed: 0 additions & 70 deletions
This file was deleted.

app/Console/Commands/FetchAudiobookSections.php

Lines changed: 0 additions & 148 deletions
This file was deleted.

app/Console/Commands/FetchLibriVoxAudiobooks.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class FetchLibriVoxAudiobooks extends Command
2525
*
2626
* @var string
2727
*/
28-
protected $description = 'Fetch audiobooks from the Archive.org (LibriVox collection) API and store them in the database.';
28+
protected $description = 'Fetch audiobooks from the LibriVox API and store them in the database.';
2929

3030
protected LibriVoxService $libriVoxService;
3131

@@ -49,20 +49,8 @@ public function handle()
4949
{
5050
$limit = (int) $this->option('limit');
5151
$offset = (int) $this->option('offset');
52-
$since = $this->option('since'); // 'since' parameter might need custom handling for Archive.org
53-
54-
$this->info("Fetching {$limit} audiobooks from Archive.org (LibriVox collection) API (offset: {$offset}" . ($since ? ", since: {$since}" : "") . ")...");
55-
56-
$apiParams = [];
57-
if ($since) {
58-
// Archive.org's 'publicdate' field can be used with a range query
59-
// Example: 'publicdate:[2023-01-01 TO *]'
60-
// This would require adjusting the 'q' parameter in LibriVoxService
61-
// For simplicity, we'll pass it, but the service needs to interpret it.
62-
$apiParams['publicdate'] = $since;
63-
}
64-
65-
$isDryRun = $this->option('dry-run');
52+
$since = $this->option('since');
53+
$isDryRun = (bool) $this->option('dry-run'); // Cast to boolean
6654

6755
$this->info("Fetching {$limit} audiobooks from LibriVox API (offset: {$offset}" . ($since ? ", since: {$since}" : "") . ")...");
6856
if ($isDryRun) {
@@ -328,4 +316,4 @@ private function convertLanguageCodeToName(string $code): string
328316
// Use the language mapping from the config file
329317
return Config::get('languages.' . strtolower($code), ucfirst(strtolower($code)));
330318
}
331-
}
319+
}

0 commit comments

Comments
 (0)