Enhance debug logging in image fetching process to improve traceability of asset checks and downloads. Added logs for asset state, expected paths, and conditions for skipping existing files.
This commit is contained in:
parent
80aa4ea4b2
commit
8b5a39066f
@ -62,12 +62,20 @@ async function getAlbumAssets() {
|
||||
const fileName = `${asset.id}_${asset.originalFileName || 'untitled'}`;
|
||||
const outputPath = path.join(config.outputDir, fileName);
|
||||
|
||||
// Add debug logging to understand the state
|
||||
console.log(`Checking asset ${asset.id}:`);
|
||||
console.log(`- Expected path: ${outputPath}`);
|
||||
|
||||
// Check if file already exists and is in our metadata
|
||||
const existingImage = existingImages.find(img => img.id === asset.id);
|
||||
if (existingImage && fs.existsSync(existingImage.localPath)) {
|
||||
console.log(`Skipping existing file: ${fileName}`);
|
||||
images.push(existingImage);
|
||||
continue;
|
||||
if (existingImage) {
|
||||
console.log(`- Found in metadata: ${existingImage.localPath}`);
|
||||
if (fs.existsSync(existingImage.localPath)) {
|
||||
console.log(`- File exists on disk, skipping download`);
|
||||
images.push(existingImage);
|
||||
continue;
|
||||
}
|
||||
console.log(`- File not found on disk at ${existingImage.localPath}`);
|
||||
}
|
||||
|
||||
console.log(`Downloading: ${fileName}`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user