d594d00227
- Fixed theme not being reflected on gallery and admin login pages - Created GlobalThemeProvider to apply themes globally - Updated gallery and admin login pages to use dynamic CSS variables - Added complete translations for all admin sections in English and German: - Notifications management - Event view and creation - Photo upload functionality - Category management - Archive page view - Analytics dashboard - Branding and theme settings - System settings - CMS page management - Email configuration - Fixed admin photo management display issues - Fixed photo upload category assignment - Added password reset functionality for galleries - Improved error handling and user feedback 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
56 lines
1.7 KiB
JavaScript
56 lines
1.7 KiB
JavaScript
const knex = require('knex')({
|
|
client: 'sqlite3',
|
|
connection: { filename: '/app/data/photo_sharing.db' },
|
|
useNullAsDefault: true
|
|
});
|
|
|
|
async function debugEventPhotos() {
|
|
try {
|
|
// Get all photos for event 12
|
|
const photos = await knex('photos')
|
|
.where('event_id', 12)
|
|
.select('id', 'filename', 'path', 'thumbnail_path')
|
|
.orderBy('id');
|
|
|
|
console.log('Total photos for event 12:', photos.length);
|
|
console.log('\nSample photos:');
|
|
|
|
// Show first few and specific IDs that were failing
|
|
const sampleIds = [1686, 1687, 1688, 1689, 1715, 1717, 1718, 1719];
|
|
const samples = photos.filter(p => sampleIds.includes(p.id));
|
|
|
|
samples.forEach(p => {
|
|
console.log(`\nID ${p.id}: ${p.filename}`);
|
|
console.log(` Path: ${p.path}`);
|
|
console.log(` Thumbnail: ${p.thumbnail_path}`);
|
|
});
|
|
|
|
// Check for any photos without thumbnails
|
|
const noThumbs = photos.filter(p => !p.thumbnail_path);
|
|
if (noThumbs.length > 0) {
|
|
console.log(`\nPhotos without thumbnails: ${noThumbs.length}`);
|
|
noThumbs.forEach(p => console.log(` ID ${p.id}: ${p.filename}`));
|
|
}
|
|
|
|
// Check file existence for failing photos
|
|
const fs = require('fs').promises;
|
|
console.log('\nChecking file existence for samples:');
|
|
|
|
for (const photo of samples) {
|
|
const thumbPath = `/app/storage/${photo.thumbnail_path}`;
|
|
try {
|
|
await fs.access(thumbPath);
|
|
console.log(`✓ ID ${photo.id}: Thumbnail exists at ${thumbPath}`);
|
|
} catch (err) {
|
|
console.log(`✗ ID ${photo.id}: Thumbnail NOT FOUND at ${thumbPath}`);
|
|
}
|
|
}
|
|
|
|
} catch (error) {
|
|
console.error('Error:', error);
|
|
} finally {
|
|
knex.destroy();
|
|
}
|
|
}
|
|
|
|
debugEventPhotos(); |