- Increase nginx client_max_body_size from 100MB to 1GB for video support - Fix admin photo category filtering to properly handle numeric category IDs from the photo_categories table, not just legacy 'individual'/'collage' types - Add support for 'uncategorized' filter to show photos with no category
This commit is contained in:
@@ -726,13 +726,20 @@ router.get('/:eventId/photos', adminAuth, requirePermission('photos.view'), asyn
|
||||
.leftJoin('photo_categories', 'photos.category_id', 'photo_categories.id')
|
||||
.select('photos.*', 'photo_categories.name as pc_name', 'photo_categories.slug as pc_slug');
|
||||
|
||||
// Filter by type (individual/collage) - category_id maps to type
|
||||
if (category_id !== undefined) {
|
||||
if (category_id === '' || category_id === '0') {
|
||||
// For backwards compatibility, empty category means no filter
|
||||
// Don't filter anything
|
||||
} else if (category_id === 'individual' || category_id === 'collage') {
|
||||
// Filter by category_id
|
||||
if (category_id !== undefined && category_id !== '' && category_id !== '0') {
|
||||
if (category_id === 'individual' || category_id === 'collage') {
|
||||
// Legacy type-based filtering
|
||||
query = query.where({ 'photos.type': category_id });
|
||||
} else if (category_id === 'uncategorized') {
|
||||
// Filter for photos with no category assigned
|
||||
query = query.whereNull('photos.category_id');
|
||||
} else {
|
||||
// Numeric category ID from photo_categories table
|
||||
const numericCategoryId = parseInt(category_id, 10);
|
||||
if (!isNaN(numericCategoryId)) {
|
||||
query = query.where({ 'photos.category_id': numericCategoryId });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -8,8 +8,8 @@ server {
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
resolver_timeout 5s;
|
||||
|
||||
# Allow larger file uploads (up to 100MB)
|
||||
client_max_body_size 100M;
|
||||
# Allow larger file uploads (up to 1GB for video support)
|
||||
client_max_body_size 1G;
|
||||
client_body_timeout 300s;
|
||||
|
||||
# Gzip compression
|
||||
@@ -60,8 +60,8 @@ server {
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
proxy_read_timeout 86400;
|
||||
|
||||
# Allow larger uploads for API endpoints
|
||||
client_max_body_size 100M;
|
||||
# Allow larger uploads for API endpoints (up to 1GB for video support)
|
||||
client_max_body_size 1G;
|
||||
client_body_timeout 300s;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user