Major Feature: Multi-Destination Device Configuration
Devices can now have multiple transfer rules, each with its own destination, filters, and settings. This allows you to intelligently route different types of files from a single device to multiple locations.
- Each device can have unlimited transfer rules
- Each rule operates independently with its own settings
- Rules are processed in parallel when a device is detected
Three types of filters can be combined per rule:
- File Types: Filter by extension (
.jpg,.raw,.mp4, etc.) - Source Path Patterns: Filter by directory structure (
**/DCIM/**,**/PANO/**) - Filename Patterns: Filter by filename (
IMG_*,*_PANO_*)
All filters use glob pattern matching and are combined with AND logic.
- Clean, intuitive tabbed interface in the web UI
- "Basic Info" tab for device-level settings
- Separate tab for each transfer rule
- Easy rule management: add, edit, delete
- Chip-style input for multi-value fields (file types, patterns)
- Config files now include a version number
- Automatic migration system handles upgrades
- Backups created before migration
- Transfer records now include
rule_idandrule_name - Better tracking of which rule processed which files
New Files:
src/media_ingest/core/migration.py- Configuration migration system
Modified Files:
-
src/media_ingest/core/config.py- Added migration support
- Added transfer rule CRUD methods
- Version-aware config loading/saving
-
src/media_ingest/core/database.py- Added
rule_idandrule_namecolumns - Automatic schema migration
- Added
-
src/media_ingest/core/transfer.py- Support for rule-specific transfers
- Enhanced file filtering with path and filename patterns
- V1 backwards compatibility in transfer logic
-
src/main.py- Queue multiple transfers for devices with multiple rules
- Pass rule information to database
-
src/media_ingest/web/server.py- New API endpoints for transfer rule management
- Enhanced device creation/update endpoints
- Support for rule-specific manual triggers
API Endpoints Added:
GET /api/devices/<device_id>/transfer-rules- List rulesPOST /api/devices/<device_id>/transfer-rules- Add rulePUT /api/devices/<device_id>/transfer-rules/<rule_id>- Update ruleDELETE /api/devices/<device_id>/transfer-rules/<rule_id>- Delete rule
Modified Files:
-
templates/devices.html- Complete redesign with tabbed interface
- New CSS for tabs and chip inputs
- Modal size increased for better UX
-
static/js/devices.js- Complete rewrite for v2 support
- Dynamic tab rendering
- Chip input management
- Rule CRUD operations
- Enhanced validation
Modified Files:
config/devices.example.yaml- Updated with v2 examples showing multiple rulesREADME.md- Updated features and configuration documentation
New Files:
MIGRATION_v2.md- Migration guide and documentationCHANGELOG_v2.md- This file
- Detection: On startup, ConfigManager checks config version
- Backup: Creates timestamped backup in
config/backups/ - Migration: Converts v1 format to v2:
- Device-level settings → single transfer rule
- Preserves all existing configuration
- Adds new fields with sensible defaults
- Save: Writes v2 config with version number
Before (V1):
devices:
- name: "Camera"
drop_location: "/mnt/nas/photos"
file_types: [".jpg"]
# ... other settings at device levelAfter (V2):
version: 2
devices:
- name: "Camera"
transfer_rules:
- name: "Camera"
drop_location: "/mnt/nas/photos"
file_types: [".jpg"]
source_path_patterns: []
filename_patterns: []
# ... settings now at rule leveltransfer_rules array instead of flat settings.
- Migrated devices function identically to before (single rule)
- All existing features and settings preserved
- Database schema is backwards compatible (adds columns, doesn't remove)
- V1 configs are auto-migrated on first run
- Cannot use V1 config format after migration
- Old API format for device creation (automatically converted on save)
- name: "Camera SD Card"
transfer_rules:
- name: "Photos"
drop_location: "/mnt/nas/photos"
file_types: [".jpg", ".raw", ".dng"]
- name: "Videos"
drop_location: "/mnt/nas/videos"
file_types: [".mp4", ".mov"]- name: "Drone"
transfer_rules:
- name: "Panoramas"
drop_location: "/mnt/nas/photos/panos"
source_path_patterns: ["**/PANO/**"]
file_types: [".jpg", ".dng"]
- name: "Regular Photos"
drop_location: "/mnt/nas/photos/drone"
source_path_patterns: ["**/DCIM/**"]
filename_patterns: ["DJI_*"]- name: "Main Camera"
transfer_rules:
- name: "RAW"
drop_location: "/mnt/nas/photos/raw"
file_types: [".cr2", ".nef"]
preserve_structure: false
- name: "JPEG"
drop_location: "/mnt/nas/photos/jpeg"
file_types: [".jpg"]
preserve_structure: true- Backup First: Before upgrading, backup your
config/directory - Test Migration: Verify your devices migrated correctly in the web UI
- Test Transfers: Plug in a device and verify transfers work as expected
- Check Logs: Review service logs for any migration warnings
- Verify Filters: If using new filtering features, test with sample files
None at this time.
-
Stop the service:
sudo systemctl stop media-ingest
-
Backup configuration (recommended):
cp -r config config.backup.$(date +%Y%m%d) -
Pull latest code:
git pull
-
Start the service:
sudo systemctl start media-ingest
-
Check logs for migration messages:
sudo journalctl -u media-ingest -f
-
Verify web UI: Check that devices appear correctly with their transfer rules
- See
MIGRATION_v2.mdfor detailed migration information - Check
config/devices.example.yamlfor configuration examples - Open GitHub issues for bugs or questions