Enhance FaceAI integration with live checks and metadata handling
All checks were successful
Publish FaceAI Container / publish (push) Successful in 3m22s
All checks were successful
Publish FaceAI Container / publish (push) Successful in 3m22s
- Added optional live FaceAI checks in README.md - Implemented relative storage segment parsing in race-storage.js - Updated server.js to include relative directory in race storage - Refactored legacyAssets.js to resolve asset base URL dynamically - Expanded live race tests to validate FaceAI app launch and metadata - Introduced portrait image handling for live upload flow - Updated faceai_handoff.php to process race storage relative directory
This commit is contained in:
parent
c88b373c73
commit
bb60201ad4
9 changed files with 214 additions and 25 deletions
|
|
@ -30,6 +30,20 @@ function sanitizePathSegment(value) {
|
|||
return normalized;
|
||||
}
|
||||
|
||||
function parseRelativeStorageSegments(value) {
|
||||
const normalized = String(value || '').trim().replace(/\\/g, '/');
|
||||
|
||||
if (!normalized) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return normalized
|
||||
.split('/')
|
||||
.map((segment) => segment.trim())
|
||||
.filter(Boolean)
|
||||
.map((segment) => sanitizePathSegment(segment));
|
||||
}
|
||||
|
||||
export function normalizeRaceFolderName(value) {
|
||||
return String(value || '')
|
||||
.trim()
|
||||
|
|
@ -49,9 +63,16 @@ export function buildMonthFolder(year, monthIndex) {
|
|||
}
|
||||
|
||||
export function buildRaceStorage(storageInput = {}) {
|
||||
const year = sanitizePathSegment(storageInput.year);
|
||||
const monthFolder = sanitizePathSegment(storageInput.monthFolder);
|
||||
const raceFolder = sanitizePathSegment(normalizeRaceFolderName(storageInput.raceFolder));
|
||||
const relativeSegments = parseRelativeStorageSegments(storageInput.relativeDir);
|
||||
const relativeYear = relativeSegments[0] || '';
|
||||
const relativeMonthFolder = relativeSegments.length >= 3 ? relativeSegments[1] : '';
|
||||
const relativeRaceFolder = relativeSegments.length >= 3
|
||||
? relativeSegments[2]
|
||||
: (relativeSegments.length >= 2 ? relativeSegments[1] : '');
|
||||
|
||||
const year = sanitizePathSegment(storageInput.year || relativeYear);
|
||||
const monthFolder = sanitizePathSegment(storageInput.monthFolder || relativeMonthFolder);
|
||||
const raceFolder = sanitizePathSegment(normalizeRaceFolderName(storageInput.raceFolder || relativeRaceFolder));
|
||||
|
||||
if (!year || !monthFolder || !raceFolder) {
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue