From 877fccbb52cbdd50ea44069e08f036d411ae7b2f Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sat, 28 Feb 2026 12:56:53 -0500 Subject: [PATCH] refactor(api): rename scan_frequency_minutes to scan_poll_interval_seconds - Update API field from scan_frequency_minutes to scan_poll_interval_seconds - Update database schema default value key - Update Bruno API collection requests and documentation - Update OpenAPI documentation examples and field descriptions --- bruno/library/Get Scan Settings.yml | 2 +- bruno/library/Update Scan Settings.yml | 4 ++-- bruno/system/update-scan-settings.yml | 12 ++++++------ database/schema/schema.sql | 2 +- docs/developer/api-reference.md | 2 +- docs/developer/api/system/settings.md | 16 ++++++++-------- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/bruno/library/Get Scan Settings.yml b/bruno/library/Get Scan Settings.yml index 35d7432..ac03266 100644 --- a/bruno/library/Get Scan Settings.yml +++ b/bruno/library/Get Scan Settings.yml @@ -29,7 +29,7 @@ docs: |- **Authentication:** Required (Bearer token) **Response:** - - `scan_frequency_minutes` (number): Minutes between automatic scans (minimum 1) + - `scan_poll_interval_seconds` (number): Minutes between automatic scans (minimum 1) - `auto_scan_enabled` (boolean): Whether automatic scanning is enabled - `last_scan_at` (string, optional): Timestamp of last scan - `next_scan_at` (string, optional): Timestamp of next scheduled scan diff --git a/bruno/library/Update Scan Settings.yml b/bruno/library/Update Scan Settings.yml index 825897b..acf30a0 100644 --- a/bruno/library/Update Scan Settings.yml +++ b/bruno/library/Update Scan Settings.yml @@ -13,7 +13,7 @@ http: type: json data: |- { - "scan_frequency_minutes": 30, + "scan_poll_interval_seconds": 30, "auto_scan_enabled": true } auth: inherit @@ -36,7 +36,7 @@ docs: |- **Authentication:** Required **Request Body:** - - `scan_frequency_minutes` (integer, required): Minutes between automatic scans (15-1440) + - `scan_poll_interval_seconds` (integer, required): Minutes between automatic scans (15-1440) - `auto_scan_enabled` (boolean, required): Whether automatic scanning is enabled **Response:** diff --git a/bruno/system/update-scan-settings.yml b/bruno/system/update-scan-settings.yml index 806e5fc..510b8fc 100644 --- a/bruno/system/update-scan-settings.yml +++ b/bruno/system/update-scan-settings.yml @@ -4,22 +4,22 @@ info: seq: 2 http: method: PUT - url: '{{base_url}}/api/libraries/scan-settings' + url: "{{base_url}}/api/libraries/scan-settings" auth: inherit body: type: json json: - scan_frequency_minutes: 30 + scan_poll_interval_seconds: 30 auto_scan_enabled: true headers: - - key: Content-Type - value: application/json + - key: Content-Type + value: application/json docs: |- ## Update System Scan Settings - + Updates system-wide scan settings that apply to all libraries. - + **Authentication**: Admin token required **Request**: Scan frequency (15-1440 minutes) and enabled status **Response**: Success message diff --git a/database/schema/schema.sql b/database/schema/schema.sql index 4eb588f..2dcb0e3 100644 --- a/database/schema/schema.sql +++ b/database/schema/schema.sql @@ -43,7 +43,7 @@ CREATE TABLE IF NOT EXISTS system_settings ( -- Insert default system settings INSERT INTO system_settings (setting_key, setting_value, description) VALUES -('scan_frequency_minutes', '60', 'How often to scan all libraries in minutes'), +('scan_poll_interval_seconds', '60', 'How often to scan all libraries in minutes'), ('auto_scan_enabled', 'true', 'Whether auto-scanning is enabled system-wide') ON CONFLICT (setting_key) DO NOTHING; diff --git a/docs/developer/api-reference.md b/docs/developer/api-reference.md index 02dad29..a6359bd 100644 --- a/docs/developer/api-reference.md +++ b/docs/developer/api-reference.md @@ -209,7 +209,7 @@ Authorization: Bearer Content-Type: application/json { - "scan_frequency_minutes": 60, + "scan_poll_interval_seconds": 60, "auto_scan_enabled": true } ``` diff --git a/docs/developer/api/system/settings.md b/docs/developer/api/system/settings.md index 699e058..07b2e8c 100644 --- a/docs/developer/api/system/settings.md +++ b/docs/developer/api/system/settings.md @@ -31,14 +31,14 @@ Retrieve the current system-wide scan settings. ```json { - "scan_frequency_minutes": 60, + "scan_poll_interval_seconds": 60, "auto_scan_enabled": true } ``` **Fields**: -- `scan_frequency_minutes` (integer): How often to scan all libraries in minutes (15-1440) +- `scan_poll_interval_seconds` (integer): How often to scan all libraries in minutes (15-1440) - `auto_scan_enabled` (boolean): Whether auto-scanning is enabled system-wide **Example**: @@ -62,14 +62,14 @@ Update the system-wide scan settings. ```json { - "scan_frequency_minutes": 30, + "scan_poll_interval_seconds": 30, "auto_scan_enabled": true } ``` **Fields**: -- `scan_frequency_minutes` (integer, required): How often to scan all libraries in minutes +- `scan_poll_interval_seconds` (integer, required): How often to scan all libraries in minutes - Minimum: 15 (15 minutes) - Maximum: 1440 (24 hours) - Default: 60 @@ -88,7 +88,7 @@ Update the system-wide scan settings. ```json { - "scan_frequency_minutes": 30, + "scan_poll_interval_seconds": 30, "auto_scan_enabled": true, "message": "scan settings updated successfully" } @@ -104,7 +104,7 @@ Update the system-wide scan settings. **Validation Rules**: -- `scan_frequency_minutes` must be between 15 and 1440 minutes +- `scan_poll_interval_seconds` must be between 15 and 1440 minutes - Both fields are required **Example**: @@ -114,7 +114,7 @@ curl -X PUT https://bookhoard.example.com/api/libraries/scan-settings \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ - "scan_frequency_minutes": 30, + "scan_poll_interval_seconds": 30, "auto_scan_enabled": true }' ``` @@ -125,7 +125,7 @@ curl -X PUT https://bookhoard.example.com/api/libraries/scan-settings \ ### Scan Frequency -The `scan_frequency_minutes` setting determines how often the system will automatically scan all libraries for new media files. The scheduler will trigger scans for all libraries at the configured interval. +The `scan_poll_interval_seconds` setting determines how often the system will automatically scan all libraries for new media files. The scheduler will trigger scans for all libraries at the configured interval. **Constraints**: