Features
Flexible media support
- Any file type - Support for images, videos, audio, documents, and other media
- Optional thumbnails - Works with devices that don’t generate thumbnails
- Media type detection - Automatic classification based on file extensions
- File size tracking - Monitors file sizes and metadata
Dynamic device actions
- Configurable actions - Use any PocketBase-configured action
- Fallback actions - Tries multiple action names (
list-events,list-files,list-media) - Parameter templating - Support for dynamic parameters in action commands
- Flexible output parsing - Handles various output formats from devices
Event publishing methods
The Studio service supports multiple ways to publish media events:- File-based upload - Simple directory-based file upload system
- Harvesting - Automatic polling of device events at configurable intervals
- Direct upload - HTTP POST endpoint for direct event upload with files
- URL-based upload - Get pre-signed URLs for secure file uploads
Hook system
- Event-based hooks - Execute device actions on specific events
- Configurable triggers - 7 different hook event types
- Parameter injection - Automatic context parameter injection
- Device-specific or global - Hooks can apply to specific devices or all devices
Directory structure
The service creates the following directory structure for each device:API endpoints
Media management
GET /api/gallery/:device/paths- Get device-specific upload pathsGET /api/gallery/:device/events- List media events with type filteringPOST /api/gallery/:device/start- Start media service with flexible configPOST /api/gallery/:device/stop- Stop media serviceGET /api/gallery/:device/status- Get service statusPOST /api/gallery/:device/pull/:eventId- Pull specific eventGET /api/gallery/:device/stats- Get media statistics with type breakdownDELETE /api/gallery/:device/events/:eventId- Delete media event
Event upload
POST /api/gallery/:device/upload- Direct event upload with filesGET /api/gallery/:device/upload-url- Get pre-signed upload URLs
Hook management
GET /api/hooks- List all hooks (optional device filter)POST /api/hooks- Create new hookPATCH /api/hooks/:id- Update hookDELETE /api/hooks/:id- Delete hookGET /api/hooks/events/:eventType- Get hooks by event type
File watcher management
GET /api/watchers- Get status of all file watchersPOST /api/watchers/refresh- Refresh all file watchersPOST /api/watchers/sync- Sync watchers with current device listPOST /api/watchers/:deviceId/add- Add watcher for specific deviceDELETE /api/watchers/:deviceId- Remove watcher for specific deviceGET /api/watchers/:deviceId/status- Check if watcher is activePOST /api/watchers/cleanup-orphaned- Clean up orphaned watchers
File-based upload workflow
The simplest way to publish events:- Get device paths:
- Upload files:
- Automatic processing:
- Detect new files in the incoming directory
- Create gallery records with metadata
- Move processed files to the processed directory
- Handle thumbnails if present
- Trigger appropriate hooks
Authentication
All Studio API endpoints require authentication using:- Bearer token - JWT token from PocketBase authentication
- API key - Using
X-API-Keyheader