diff --git a/Web/app.py b/Web/app.py index 9e015e1..eccc091 100755 --- a/Web/app.py +++ b/Web/app.py @@ -5555,10 +5555,10 @@ def upload_item(): app.logger.info(f"Starting image upload session {upload_session_id} - Files: {len(images)}, User: {encrypt_text(username)}") for index, image in enumerate(images): - if upload_mode == 'library': - app.logger.info(f"[Upload {upload_session_id}] Skipping manual upload (Library Mode)") - skipped_count += 1 - continue + #if upload_mode == 'library': + # app.logger.info(f"[Upload {upload_session_id}] Skipping manual upload (Library Mode)") + # skipped_count += 1 + # continue if not image or not image.filename: skipped_count += 1 diff --git a/Web/templates/library_table.html b/Web/templates/library_table.html index e8e51d2..59e56d8 100644 --- a/Web/templates/library_table.html +++ b/Web/templates/library_table.html @@ -1252,7 +1252,6 @@ return div.innerHTML; } - // Opens the modal and fetches the data function showItemDetail(itemId) { const detailContent = document.getElementById('detailContent'); const detailModal = document.getElementById('detailModal'); @@ -1265,11 +1264,15 @@ const item = libraryItems.find(i => i._id === itemId); let mediaHtml = ''; - if (item && item.Images && item.Images.length > 0) { + // Sicherstellen, dass item.Images existiert und ein Array mit Elementen ist + if (item && Array.isArray(item.Images) && item.Images.length > 0) { const imagesHtml = item.Images.map((image, index) => { - const imageSrc = image.startsWith('/uploads/') || image.startsWith('http') ? - image : - `{{ url_for('uploaded_file', filename='') }}${image}`; + // Robuste Pfad-Generierung: Startet es nicht mit http oder /, setzen wir /uploads/ davor + let imageSrc = image; + if (!image.startsWith('http') && !image.startsWith('/')) { + // Passe "/uploads/" an, falls dein Server-Ordner für Bilder anders heißt (z.B. "/static/uploads/") + imageSrc = '/uploads/' + image; + } const thumbnailInfo = item.ThumbnailInfo && item.ThumbnailInfo[index]; const isVideo = isVideoFile(image); @@ -1280,21 +1283,22 @@ : imageSrc; if (thumbnailInfo && thumbnailInfo.has_thumbnail) { - return `
- ${escapeHtml(item.Name || '')} -
- ▶ -
-
`; + return ` +
+ ${escapeHtml(item.Name || 'Medium')} +
+ ▶ +
+
`; } else { - return `
VIDEO
`; + return `
VIDEO
`; } } else { const imageSrcFinal = thumbnailInfo && thumbnailInfo.has_thumbnail ? thumbnailInfo.thumbnail_url : imageSrc; - return `${escapeHtml(item.Name || '')}`; + return `${escapeHtml(item.Name || 'Medium')}`; } }).join(''); @@ -1315,7 +1319,7 @@ }) .catch(err => { console.error('Error loading detail:', err); - detailContent.innerHTML = '

Sorry, we could not load the item details. Please try again later.

'; + detailContent.innerHTML = '

Entschuldigung, die Details konnten nicht geladen werden. Bitte versuche es später erneut.

'; }); }