From f66c941c1d570cfe9e5da66671421b574de6431c Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 30 Jul 2026 21:09:59 -0500 Subject: [PATCH] Stop the content edit dialog rewriting types it cannot represent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Opening Edit on a YouTube item and pressing Save Changes — with nothing else touched — turned it into an MP4. The type dropdown offers six fixed options and is rendered unconditionally. For video/youtube no option matched, so the browser selected the first one, video/mp4. The save handler then reads the select's value and sends it because it differs from the stored type: const mimeType = overlay.querySelector('#editMimeType').value; // 'video/mp4' if (mimeType !== contentItem.mime_type) updateData.mime_type = mimeType; and the server stores what it is sent. mime_type is the renderer selector in every player, so the item became an "MP4" whose source is a YouTube embed page: a dead slide on every screen in the playlist. It could not be undone from the dialog either, because there is no video/youtube option to set it back, and the YouTube-specific controls disappear once the type has changed. The same applies to uploads the sniffer accepts but the list omits — the sniffer allows fifteen types, the dropdown covers six — so .mov, .svg, .heic, .avif and .bmp were all rewritten the same way. The dialog now includes the item's actual type as a selected option whenever the fixed six cannot express it, so opening and saving is a no-op and the type is never silently changed. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Uaeo9MvzKoyXuN6ZsbhtkL --- frontend/js/views/content-library.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/js/views/content-library.js b/frontend/js/views/content-library.js index 9462118..180eb2b 100644 --- a/frontend/js/views/content-library.js +++ b/frontend/js/views/content-library.js @@ -714,6 +714,15 @@ function showEditModal(contentItem, onSave) { + ${['video/mp4','video/webm','image/jpeg','image/png','image/gif','image/webp'].includes(contentItem.mime_type) ? '' : ` + + `}