Compare commits
2 commits
4f003bb5a9
...
0926c52a00
| Author | SHA1 | Date | |
|---|---|---|---|
| 0926c52a00 | |||
| 77e48b8139 |
9 changed files with 115 additions and 106 deletions
|
|
@ -7,10 +7,10 @@ Write-Host " 3 = 1/2 dei core (predefinito)"
|
||||||
Write-Host " 4 = 3/4 dei core"
|
Write-Host " 4 = 3/4 dei core"
|
||||||
Write-Host " 5 = n-2 core"
|
Write-Host " 5 = n-2 core"
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
$input = Read-Host "Inserisci il livello (1-5) oppure premi Invio per usare il predefinito (3)"
|
$multicoreChoice = Read-Host "Inserisci il livello (1-5) oppure premi Invio per usare il predefinito (3)"
|
||||||
|
|
||||||
if ($input -match '^[1-5]$') {
|
if ($multicoreChoice -match '^[1-5]$') {
|
||||||
$multicore = [int]$input
|
$multicore = [int]$multicoreChoice
|
||||||
} else {
|
} else {
|
||||||
$multicore = -1
|
$multicore = -1
|
||||||
}
|
}
|
||||||
|
|
@ -94,13 +94,33 @@ if (-not $inputPath) {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$inputFolder = Get-Item -LiteralPath $inputPath -ErrorAction Stop
|
||||||
|
$raceName = $inputFolder.Name
|
||||||
|
$safeRaceName = ($raceName -replace '[<>:"/\\|?*]', ' ').Trim()
|
||||||
|
$safeRaceName = $safeRaceName -replace '\s+', '_'
|
||||||
|
if (-not $safeRaceName) {
|
||||||
|
$safeRaceName = 'race'
|
||||||
|
}
|
||||||
|
|
||||||
|
$timestamp = Get-Date -Format 'yyyyMMdd_HHmmss'
|
||||||
|
$encoderDir = Join-Path $PSScriptRoot "face_encoder_cpu"
|
||||||
|
$outputDir = Join-Path $encoderDir "output"
|
||||||
|
$outputFile = Join-Path $outputDir ("face_encodings_{0}_{1}.pkl" -f $timestamp, $safeRaceName)
|
||||||
|
$logFile = Join-Path $outputDir ("encoder_log_{0}_{1}.txt" -f $timestamp, $safeRaceName)
|
||||||
|
|
||||||
|
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
|
||||||
|
|
||||||
# --- Build argument list ---
|
# --- Build argument list ---
|
||||||
$encoderExe = Join-Path $PSScriptRoot "face_encoder_cpu\face_encoder_cpu.exe"
|
$encoderExe = Join-Path $encoderDir "face_encoder_cpu.exe"
|
||||||
|
|
||||||
$encoderArgs = [System.Collections.Generic.List[string]]::new()
|
$encoderArgs = [System.Collections.Generic.List[string]]::new()
|
||||||
$encoderArgs.Add("-i")
|
$encoderArgs.Add("-i")
|
||||||
$encoderArgs.Add($inputPath)
|
$encoderArgs.Add($inputFolder.FullName)
|
||||||
$encoderArgs.Add("-r")
|
$encoderArgs.Add("-r")
|
||||||
|
$encoderArgs.Add("-o")
|
||||||
|
$encoderArgs.Add($outputFile)
|
||||||
|
$encoderArgs.Add("-l")
|
||||||
|
$encoderArgs.Add($logFile)
|
||||||
|
|
||||||
if ($multicore -ge 0) {
|
if ($multicore -ge 0) {
|
||||||
$encoderArgs.Add("-m")
|
$encoderArgs.Add("-m")
|
||||||
|
|
@ -108,9 +128,22 @@ if ($multicore -ge 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
# --- Run encoder ---
|
# --- Run encoder ---
|
||||||
Write-Host "Input folder : $inputPath"
|
Write-Host "Input folder : $($inputFolder.FullName)"
|
||||||
|
Write-Host "Race name : $raceName"
|
||||||
Write-Host "Multicore : $(if ($multicore -ge 0) { $multicore } else { 'default (3)' })"
|
Write-Host "Multicore : $(if ($multicore -ge 0) { $multicore } else { 'default (3)' })"
|
||||||
|
Write-Host "Output file : $outputFile"
|
||||||
|
Write-Host "Log file : $logFile"
|
||||||
Write-Host "Command : $encoderExe $encoderArgs"
|
Write-Host "Command : $encoderExe $encoderArgs"
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
|
|
||||||
& $encoderExe @encoderArgs
|
& $encoderExe @encoderArgs
|
||||||
|
|
||||||
|
$encoderExitCode = $LASTEXITCODE
|
||||||
|
|
||||||
|
if ($encoderExitCode -eq 0 -and (Test-Path -LiteralPath $outputFile)) {
|
||||||
|
Start-Process explorer.exe "/select,`"$outputFile`""
|
||||||
|
} elseif ($encoderExitCode -eq 0) {
|
||||||
|
Write-Warning "Encoding completed, but the expected output file was not found: $outputFile"
|
||||||
|
}
|
||||||
|
|
||||||
|
exit $encoderExitCode
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { defineConfig } = require('@playwright/test');
|
const { defineConfig } = require('@playwright/test');
|
||||||
|
const { loadLiveEnv } = require('./tests/live-site/load-live-env');
|
||||||
|
|
||||||
|
loadLiveEnv();
|
||||||
|
|
||||||
const authFile = path.join(__dirname, 'tests/live-site/.auth/user.json');
|
const authFile = path.join(__dirname, 'tests/live-site/.auth/user.json');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
const { chromium } = require('playwright');
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
async function run() {
|
|
||||||
const browser = await chromium.launch();
|
|
||||||
const context = await browser.newContext();
|
|
||||||
const page = await context.newPage();
|
|
||||||
|
|
||||||
try {
|
|
||||||
const loginUrl = process.env.LIVE_SITE_LOGIN_URL;
|
|
||||||
const raceUrl = process.env.LIVE_SITE_RACE_URL;
|
|
||||||
|
|
||||||
console.log('--- Step 1: Navigating to Login ---');
|
|
||||||
await page.goto(loginUrl, { waitUntil: 'load' });
|
|
||||||
|
|
||||||
console.log('--- Step 2: Filling credentials ---');
|
|
||||||
await page.type('#login', process.env.LIVE_SITE_USERNAME);
|
|
||||||
await page.type('#pwd', process.env.LIVE_SITE_PASSWORD);
|
|
||||||
|
|
||||||
console.log('--- Step 3: Clicking Accedi ---');
|
|
||||||
await page.click('button:has-text("Accedi")');
|
|
||||||
await page.waitForTimeout(5000); // Give it time to process and redirect
|
|
||||||
|
|
||||||
console.log('--- Step 4: Navigating to Race Page ---');
|
|
||||||
const response = await page.goto(raceUrl, { waitUntil: 'load' });
|
|
||||||
|
|
||||||
console.log('Race Page URL:', page.url());
|
|
||||||
console.log('HTTP Status:', response.status());
|
|
||||||
|
|
||||||
const cookies = await context.cookies();
|
|
||||||
const cookieNames = cookies.map(c => c.name);
|
|
||||||
console.log('Cookies:', cookieNames.join(', '));
|
|
||||||
console.log('rus_faceai_identity:', cookieNames.includes('rus_faceai_identity'));
|
|
||||||
console.log('JSESSIONID:', cookieNames.includes('JSESSIONID'));
|
|
||||||
|
|
||||||
const logoutCount = await page.locator('a[href*="logout"]').count();
|
|
||||||
const loginCount = await page.locator('a[href*="login"]').count();
|
|
||||||
console.log('Logout Link Count:', logoutCount);
|
|
||||||
console.log('Login Link Count:', loginCount);
|
|
||||||
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error occurred:', err.message);
|
|
||||||
} finally {
|
|
||||||
await browser.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
run();
|
|
||||||
|
|
@ -11,11 +11,16 @@ const {
|
||||||
|
|
||||||
const LIVE_EXPECTED_RACE_STORAGE = {
|
const LIVE_EXPECTED_RACE_STORAGE = {
|
||||||
year: '2026',
|
year: '2026',
|
||||||
monthFolder: '04.APRILE',
|
monthFolder: '03.MARZO',
|
||||||
raceFolder: 'HMF_2026',
|
raceFolder: 'HMF_2026',
|
||||||
relativeDir: '2026/04.APRILE/HMF_2026'
|
relativeDir: '2026/03.MARZO/HMF_2026'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const LIVE_SAMPLE_PHOTO_IDS = [
|
||||||
|
'21.ARRIVO_CON TEMPO\\DSC_8385.JPG',
|
||||||
|
'21.ARRIVO_CON TEMPO\\DSC_8295.JPG'
|
||||||
|
];
|
||||||
|
|
||||||
function escapeRegExp(value) {
|
function escapeRegExp(value) {
|
||||||
return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||||
}
|
}
|
||||||
|
|
@ -175,10 +180,7 @@ async function expectLegacyFaceAiGalleryToRemainStable(page, expectedPhotoIds, h
|
||||||
}
|
}
|
||||||
|
|
||||||
test('renders the exact live FaceAI filtered sample URL with visible thumbnails', async ({ page }) => {
|
test('renders the exact live FaceAI filtered sample URL with visible thumbnails', async ({ page }) => {
|
||||||
const samplePhotoIds = [
|
const samplePhotoIds = LIVE_SAMPLE_PHOTO_IDS;
|
||||||
'00.PANORAMICA\\GIC_7918.JPG',
|
|
||||||
'02.PARTENZA\\GIC_7918.JPG'
|
|
||||||
];
|
|
||||||
const sampleUrl = `${LIVE_SITE_BASE_URL}/42%20HALF%20MARATHON%20FIRENZE_gara-1018545---48-1.html?faceaiMatchSource=faceai&faceaiMatchCount=2&faceaiPhotoIds=${encodeURIComponent(samplePhotoIds.join(','))}`;
|
const sampleUrl = `${LIVE_SITE_BASE_URL}/42%20HALF%20MARATHON%20FIRENZE_gara-1018545---48-1.html?faceaiMatchSource=faceai&faceaiMatchCount=2&faceaiPhotoIds=${encodeURIComponent(samplePhotoIds.join(','))}`;
|
||||||
|
|
||||||
await ensureLiveAuthenticatedRacePage(page);
|
await ensureLiveAuthenticatedRacePage(page);
|
||||||
|
|
@ -197,7 +199,7 @@ test('renders the exact live FaceAI filtered sample URL with visible thumbnails'
|
||||||
await expectLegacyFaceAiGalleryToRemainStable(page, samplePhotoIds);
|
await expectLegacyFaceAiGalleryToRemainStable(page, samplePhotoIds);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('keeps the live Firenze FaceAI race storage metadata pinned to April 2026', async ({ page }) => {
|
test('keeps the live Firenze FaceAI race storage metadata pinned to the stored server path', async ({ page }) => {
|
||||||
await ensureLiveAuthenticatedRacePage(page);
|
await ensureLiveAuthenticatedRacePage(page);
|
||||||
|
|
||||||
await expect(page.locator('#faceAiRaceYear')).toHaveValue(LIVE_EXPECTED_RACE_STORAGE.year);
|
await expect(page.locator('#faceAiRaceYear')).toHaveValue(LIVE_EXPECTED_RACE_STORAGE.year);
|
||||||
|
|
@ -217,10 +219,7 @@ test('keeps the live Firenze FaceAI race storage metadata pinned to April 2026',
|
||||||
});
|
});
|
||||||
|
|
||||||
test('resolves the live Firenze sample photo lookups inside the current race', async ({ page }) => {
|
test('resolves the live Firenze sample photo lookups inside the current race', async ({ page }) => {
|
||||||
const samplePhotoIds = [
|
const samplePhotoIds = LIVE_SAMPLE_PHOTO_IDS;
|
||||||
'00.PANORAMICA\\GIC_7918.JPG',
|
|
||||||
'02.PARTENZA\\GIC_7918.JPG'
|
|
||||||
];
|
|
||||||
|
|
||||||
await ensureLiveAuthenticatedRacePage(page);
|
await ensureLiveAuthenticatedRacePage(page);
|
||||||
|
|
||||||
|
|
@ -302,10 +301,9 @@ test('returns to the live race page from FaceAI without leaving the legacy spinn
|
||||||
expect(bodyState.ariaBusy).not.toBe('true');
|
expect(bodyState.ariaBusy).not.toBe('true');
|
||||||
});
|
});
|
||||||
|
|
||||||
test.skip(!LIVE_SITE_RUN_UPLOAD_FLOW, 'Set LIVE_SITE_RUN_UPLOAD_FLOW=1 to exercise the live upload flow.');
|
|
||||||
|
|
||||||
test('accepts the supplied portrait image for the live upload flow', async ({ page }) => {
|
test('accepts the supplied portrait image for the live upload flow', async ({ page }) => {
|
||||||
test.slow();
|
test.slow();
|
||||||
|
test.skip(!LIVE_SITE_RUN_UPLOAD_FLOW, 'Set LIVE_SITE_RUN_UPLOAD_FLOW=1 to exercise the live upload flow.');
|
||||||
|
|
||||||
requirePortraitFixture();
|
requirePortraitFixture();
|
||||||
|
|
||||||
|
|
@ -356,6 +354,12 @@ test('accepts the supplied portrait image for the live upload flow', async ({ pa
|
||||||
const expectedPhotoIds = (finalUrl.searchParams.get('faceaiPhotoIds') || '').split(',').map((value) => value.trim()).filter(Boolean);
|
const expectedPhotoIds = (finalUrl.searchParams.get('faceaiPhotoIds') || '').split(',').map((value) => value.trim()).filter(Boolean);
|
||||||
expect(expectedPhotoIds.length, 'Expected the final race page URL to include at least one FaceAI photo identifier.').toBeGreaterThan(0);
|
expect(expectedPhotoIds.length, 'Expected the final race page URL to include at least one FaceAI photo identifier.').toBeGreaterThan(0);
|
||||||
|
|
||||||
|
for (const photoKey of expectedPhotoIds) {
|
||||||
|
const lookup = await lookupLivePhoto(page, photoKey);
|
||||||
|
expect(lookup.status, `Expected FaceAI to return a photo key that resolves on the current live race page: ${photoKey}`).toBe(200);
|
||||||
|
expect(lookup.payload && lookup.payload.found, `Expected FaceAI to return a photo key that exists in the current live race: ${photoKey}`).toBe(true);
|
||||||
|
}
|
||||||
|
|
||||||
const visiblePhotoIds = await waitForVisibleLegacyPhotoIds(page, expectedPhotoIds.length);
|
const visiblePhotoIds = await waitForVisibleLegacyPhotoIds(page, expectedPhotoIds.length);
|
||||||
expect(visiblePhotoIds.length, 'Expected at least one legacy race thumbnail to remain visible after FaceAI filtering.').toBeGreaterThan(0);
|
expect(visiblePhotoIds.length, 'Expected at least one legacy race thumbnail to remain visible after FaceAI filtering.').toBeGreaterThan(0);
|
||||||
expect(visiblePhotoIds.sort()).toEqual(expectedPhotoIds.slice().sort());
|
expect(visiblePhotoIds.sort()).toEqual(expectedPhotoIds.slice().sort());
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { expect } = require('@playwright/test');
|
const { expect } = require('@playwright/test');
|
||||||
|
const { loadLiveEnv } = require('./load-live-env');
|
||||||
|
|
||||||
|
loadLiveEnv();
|
||||||
|
|
||||||
const WORKSPACE_ROOT = path.resolve(__dirname, '..', '..', '..');
|
const WORKSPACE_ROOT = path.resolve(__dirname, '..', '..', '..');
|
||||||
const LIVE_SITE_BASE_URL = process.env.LIVE_SITE_BASE_URL || 'https://www.regalamiunsorriso.it';
|
const LIVE_SITE_BASE_URL = process.env.LIVE_SITE_BASE_URL || 'https://www.regalamiunsorriso.it';
|
||||||
|
|
|
||||||
52
faceai/tests/live-site/load-live-env.js
Normal file
52
faceai/tests/live-site/load-live-env.js
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
let loaded = false;
|
||||||
|
|
||||||
|
function parseEnvLine(line) {
|
||||||
|
const trimmed = String(line || '').trim();
|
||||||
|
if (!trimmed || trimmed.startsWith('#')) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const separatorIndex = trimmed.indexOf('=');
|
||||||
|
if (separatorIndex <= 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const key = trimmed.slice(0, separatorIndex).trim();
|
||||||
|
let value = trimmed.slice(separatorIndex + 1).trim();
|
||||||
|
|
||||||
|
if ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'"))) {
|
||||||
|
value = value.slice(1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return { key, value };
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadLiveEnv() {
|
||||||
|
if (loaded) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
loaded = true;
|
||||||
|
|
||||||
|
const envPath = path.resolve(__dirname, '..', '..', '.env');
|
||||||
|
if (!fs.existsSync(envPath)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const envText = fs.readFileSync(envPath, 'utf8');
|
||||||
|
for (const line of envText.split(/\r?\n/)) {
|
||||||
|
const entry = parseEnvLine(line);
|
||||||
|
if (!entry || !entry.key || Object.prototype.hasOwnProperty.call(process.env, entry.key)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
process.env[entry.key] = entry.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
loadLiveEnv
|
||||||
|
};
|
||||||
|
|
@ -14,9 +14,6 @@ All files in this rollout are deployed from the current working tree.
|
||||||
|
|
||||||
## Updated Files
|
## Updated Files
|
||||||
|
|
||||||
- `www/_js/rus-ecom-240621.js`
|
|
||||||
- `www/faceai_return.php`
|
|
||||||
- `www/faceai_photo_lookup.jsp`
|
|
||||||
- `www/fotoCR.jsp`
|
- `www/fotoCR.jsp`
|
||||||
- `www/fotoCR-en.jsp`
|
- `www/fotoCR-en.jsp`
|
||||||
|
|
||||||
|
|
@ -30,7 +27,7 @@ All files in this rollout are deployed from the current working tree.
|
||||||
- Remote host: `marco@83.149.164.4:410`
|
- Remote host: `marco@83.149.164.4:410`
|
||||||
- Remote staging path: `/home/marco/regalamiunsorriso/incoming/www`
|
- Remote staging path: `/home/marco/regalamiunsorriso/incoming/www`
|
||||||
- Remote live path: `/home/sites/regalamiunsorriso/www`
|
- Remote live path: `/home/sites/regalamiunsorriso/www`
|
||||||
- Total files in this manifest: `5`
|
- Total files in this manifest: `2`
|
||||||
|
|
||||||
## Transfer Method
|
## Transfer Method
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,23 +60,11 @@ boolean faceAiFeatureEnabled = !("0".equals(faceAiFeatureEnabledNormalized) || "
|
||||||
<%@ include file="_inc_faceai_identity.jsp" %>
|
<%@ include file="_inc_faceai_identity.jsp" %>
|
||||||
<jsp:include page="_inc_lang.jsp" flush="true" />
|
<jsp:include page="_inc_lang.jsp" flush="true" />
|
||||||
<%
|
<%
|
||||||
java.util.Date faceAiRaceDate = CR.getGara().getDataGaraInizio();
|
|
||||||
String faceAiRacePathBase = CR.getGara().getPathBase() != null ? CR.getGara().getPathBase().trim() : "";
|
String faceAiRacePathBase = CR.getGara().getPathBase() != null ? CR.getGara().getPathBase().trim() : "";
|
||||||
String faceAiRaceYear = "";
|
String faceAiRaceYear = "";
|
||||||
String faceAiRaceMonthFolder = "";
|
String faceAiRaceMonthFolder = "";
|
||||||
String faceAiRaceFolder = "";
|
String faceAiRaceFolder = "";
|
||||||
String faceAiRaceStorageRelativeDir = "";
|
String faceAiRaceStorageRelativeDir = "";
|
||||||
String faceAiExpectedYear = "";
|
|
||||||
String faceAiExpectedMonthFolder = "";
|
|
||||||
if (faceAiRaceDate != null) {
|
|
||||||
java.util.Calendar faceAiCalendar = java.util.Calendar.getInstance();
|
|
||||||
String[] faceAiMonthNames = new String[] { "GENNAIO", "FEBBRAIO", "MARZO", "APRILE", "MAGGIO", "GIUGNO", "LUGLIO", "AGOSTO", "SETTEMBRE", "OTTOBRE", "NOVEMBRE", "DICEMBRE" };
|
|
||||||
int faceAiMonthIndex;
|
|
||||||
faceAiCalendar.setTime(faceAiRaceDate);
|
|
||||||
faceAiExpectedYear = String.valueOf(faceAiCalendar.get(java.util.Calendar.YEAR));
|
|
||||||
faceAiMonthIndex = faceAiCalendar.get(java.util.Calendar.MONTH);
|
|
||||||
faceAiExpectedMonthFolder = String.format("%02d.%s", new Object[] { Integer.valueOf(faceAiMonthIndex + 1), faceAiMonthNames[faceAiMonthIndex] });
|
|
||||||
}
|
|
||||||
if (!faceAiRacePathBase.isEmpty()) {
|
if (!faceAiRacePathBase.isEmpty()) {
|
||||||
String[] faceAiPathSegments = faceAiRacePathBase.replace('\\', '/').split("/");
|
String[] faceAiPathSegments = faceAiRacePathBase.replace('\\', '/').split("/");
|
||||||
java.util.ArrayList faceAiNormalizedSegments = new java.util.ArrayList();
|
java.util.ArrayList faceAiNormalizedSegments = new java.util.ArrayList();
|
||||||
|
|
@ -114,12 +102,6 @@ if (!faceAiRacePathBase.isEmpty()) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!faceAiExpectedYear.isEmpty() && !faceAiExpectedYear.equals(faceAiRaceYear)) {
|
|
||||||
faceAiRaceYear = faceAiExpectedYear;
|
|
||||||
}
|
|
||||||
if (!faceAiExpectedMonthFolder.isEmpty() && !faceAiExpectedMonthFolder.equals(faceAiRaceMonthFolder)) {
|
|
||||||
faceAiRaceMonthFolder = faceAiExpectedMonthFolder;
|
|
||||||
}
|
|
||||||
if (faceAiRaceFolder.isEmpty()) {
|
if (faceAiRaceFolder.isEmpty()) {
|
||||||
faceAiRaceFolder = String.valueOf(CR.getGara().getId_gara());
|
faceAiRaceFolder = String.valueOf(CR.getGara().getId_gara());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,23 +60,11 @@ boolean faceAiFeatureEnabled = !("0".equals(faceAiFeatureEnabledNormalized) || "
|
||||||
<%@ include file="_inc_faceai_identity.jsp" %>
|
<%@ include file="_inc_faceai_identity.jsp" %>
|
||||||
<jsp:include page="_inc_lang.jsp" flush="true" />
|
<jsp:include page="_inc_lang.jsp" flush="true" />
|
||||||
<%
|
<%
|
||||||
java.util.Date faceAiRaceDate = CR.getGara().getDataGaraInizio();
|
|
||||||
String faceAiRacePathBase = CR.getGara().getPathBase() != null ? CR.getGara().getPathBase().trim() : "";
|
String faceAiRacePathBase = CR.getGara().getPathBase() != null ? CR.getGara().getPathBase().trim() : "";
|
||||||
String faceAiRaceYear = "";
|
String faceAiRaceYear = "";
|
||||||
String faceAiRaceMonthFolder = "";
|
String faceAiRaceMonthFolder = "";
|
||||||
String faceAiRaceFolder = "";
|
String faceAiRaceFolder = "";
|
||||||
String faceAiRaceStorageRelativeDir = "";
|
String faceAiRaceStorageRelativeDir = "";
|
||||||
String faceAiExpectedYear = "";
|
|
||||||
String faceAiExpectedMonthFolder = "";
|
|
||||||
if (faceAiRaceDate != null) {
|
|
||||||
java.util.Calendar faceAiCalendar = java.util.Calendar.getInstance();
|
|
||||||
String[] faceAiMonthNames = new String[] { "GENNAIO", "FEBBRAIO", "MARZO", "APRILE", "MAGGIO", "GIUGNO", "LUGLIO", "AGOSTO", "SETTEMBRE", "OTTOBRE", "NOVEMBRE", "DICEMBRE" };
|
|
||||||
int faceAiMonthIndex;
|
|
||||||
faceAiCalendar.setTime(faceAiRaceDate);
|
|
||||||
faceAiExpectedYear = String.valueOf(faceAiCalendar.get(java.util.Calendar.YEAR));
|
|
||||||
faceAiMonthIndex = faceAiCalendar.get(java.util.Calendar.MONTH);
|
|
||||||
faceAiExpectedMonthFolder = String.format("%02d.%s", new Object[] { Integer.valueOf(faceAiMonthIndex + 1), faceAiMonthNames[faceAiMonthIndex] });
|
|
||||||
}
|
|
||||||
if (!faceAiRacePathBase.isEmpty()) {
|
if (!faceAiRacePathBase.isEmpty()) {
|
||||||
String[] faceAiPathSegments = faceAiRacePathBase.replace('\\', '/').split("/");
|
String[] faceAiPathSegments = faceAiRacePathBase.replace('\\', '/').split("/");
|
||||||
java.util.ArrayList faceAiNormalizedSegments = new java.util.ArrayList();
|
java.util.ArrayList faceAiNormalizedSegments = new java.util.ArrayList();
|
||||||
|
|
@ -114,12 +102,6 @@ if (!faceAiRacePathBase.isEmpty()) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!faceAiExpectedYear.isEmpty() && !faceAiExpectedYear.equals(faceAiRaceYear)) {
|
|
||||||
faceAiRaceYear = faceAiExpectedYear;
|
|
||||||
}
|
|
||||||
if (!faceAiExpectedMonthFolder.isEmpty() && !faceAiExpectedMonthFolder.equals(faceAiRaceMonthFolder)) {
|
|
||||||
faceAiRaceMonthFolder = faceAiExpectedMonthFolder;
|
|
||||||
}
|
|
||||||
if (faceAiRaceFolder.isEmpty()) {
|
if (faceAiRaceFolder.isEmpty()) {
|
||||||
faceAiRaceFolder = String.valueOf(CR.getGara().getId_gara());
|
faceAiRaceFolder = String.valueOf(CR.getGara().getId_gara());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue