- Fix WebDAV service to find all 4,101 MP3 files instead of 1,023 - Add support for AIFF files (.aif, .aiff) in audio detection - Update audioMetadataService to recognize AIFF formats - Simplify BackgroundJobProgress component polling logic - Add maxDepth parameter to WebDAV directory listing - Add comprehensive test scripts for debugging WebDAV integration The WebDAV integration now correctly processes all 4,257 audio files from the music collection, including 4,101 MP3 files and 156 other audio formats (FLAC, WAV, AIFF, M4A, OGG).
55 lines
1.6 KiB
JavaScript
55 lines
1.6 KiB
JavaScript
import fetch from 'node-fetch';
|
||
|
||
async function testServerWebDAV() {
|
||
try {
|
||
console.log('🔍 Testing Server WebDAV via API:');
|
||
console.log('');
|
||
|
||
// Test the storage sync endpoint
|
||
console.log('1️⃣ Testing storage sync endpoint...');
|
||
const response = await fetch('http://localhost:3000/api/music/sync-s3', {
|
||
method: 'POST',
|
||
headers: {
|
||
'Content-Type': 'application/json',
|
||
},
|
||
body: JSON.stringify({ force: true })
|
||
});
|
||
|
||
if (response.ok) {
|
||
const result = await response.json();
|
||
console.log('✅ Storage sync started:', result);
|
||
console.log('');
|
||
|
||
// Wait a bit and check job progress
|
||
console.log('2️⃣ Waiting for job to start...');
|
||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||
|
||
const jobsResponse = await fetch('http://localhost:3000/api/background-jobs/jobs');
|
||
if (jobsResponse.ok) {
|
||
const jobs = await jobsResponse.json();
|
||
const latestJob = jobs.jobs[jobs.jobs.length - 1];
|
||
console.log('📊 Latest job status:', {
|
||
jobId: latestJob.jobId,
|
||
status: latestJob.status,
|
||
progress: latestJob.progress,
|
||
message: latestJob.message,
|
||
current: latestJob.current,
|
||
total: latestJob.total
|
||
});
|
||
|
||
if (latestJob.result) {
|
||
console.log('📊 Job result:', latestJob.result);
|
||
}
|
||
}
|
||
} else {
|
||
console.error('❌ Failed to start storage sync:', response.status, response.statusText);
|
||
}
|
||
|
||
} catch (error) {
|
||
console.error('❌ Failed to test server WebDAV:', error);
|
||
}
|
||
}
|
||
|
||
// Run the test
|
||
testServerWebDAV().catch(console.error);
|