Server Model Library - WEKIT-ECS/MIRAGE-XR GitHub Wiki
Model library capabilities and asset management functionalities were added as requested in #31. The implementation provides a unified approach to handle both Sketchfab models and internal model libraries through a centralised asset management system.
Changes
1. Asset Management System
- Refactored the asset management system to support folder structures within buckets
- Implemented unified file handling for both Sketchfab models and internal libraries
- Added support for thumbnails and metadata management
- Refactored utility functions for file operations and hash calculations
2. Model Library Features
- Added catalog management functionality
- Implemented model upload/download capabilities with proper folder organization
- Added support for catalog and model thumbnails
- Created endpoints for listing catalogs and their contents
- Implemented proper error handling and validation
3. Architecture Improvements
- Moved database helpers to utils for better code organization
- Added comprehensive logging throughout the system
- Implemented proper file cleanup for temporary files
- Added proper MIME type detection and handling
New Endpoints
Sketchfab Models
POST /sketchfab-models/post?model={model_id}
GET /sketchfab-models/get?model={model_id}
Model Library
GET /model-library/catalogs
POST /model-library/catalogs/post?catalog={catalog_name}
DELETE /model-library/catalogs/delete?catalog={catalog_name}
GET /model-library/catalogs/thumbnail/get?catalog={catalog_name}
POST /model-library/catalogs/models/post?catalog={catalog_name}&model={model_name}
GET /model-library/catalogs/models/thumbnail/get?catalog={catalog_name}&model={model_name}
Implementation Details
Models are stored in a hierarchical structure:
model-library/
├── catalog1/
│ ├── model1/
│ │ ├── model1.zip
│ │ └── thumbnail.jpg
│ └── thumbnail.jpg
└── catalog2/
└── ...