diff --git a/thrimbletrimmer/scripts/edit.js b/thrimbletrimmer/scripts/edit.js index 1bcbcce..a959a08 100644 --- a/thrimbletrimmer/scripts/edit.js +++ b/thrimbletrimmer/scripts/edit.js @@ -448,13 +448,6 @@ window.addEventListener("DOMContentLoaded", async (event) => { } document.getElementById("video-info-thumbnail-mode").value = videoInfo.thumbnail_mode; updateThumbnailInputState(); - if (videoInfo.thumbnail_time) { - document.getElementById("video").addEventListener("loadedmetadata", (_event) => { - document.getElementById("video-info-thumbnail-time").value = videoHumanTimeFromWubloaderTime( - videoInfo.thumbnail_time, - ); - }); - } // Ensure that changing values on load doesn't set keep the page dirty. globalPageState = PAGE_STATE.CLEAN; @@ -945,6 +938,12 @@ async function initializeVideoInfo() { firstChapterPlayFromStartTime.classList.add("hidden"); } + if (videoInfo.thumbnail_time) { + document.getElementById("video-info-thumbnail-time").value = videoHumanTimeFromWubloaderTime( + videoInfo.thumbnail_time, + ); + } + rangeDataUpdated(); videoElement.removeEventListener("loadedmetadata", handleInitialSetupForDuration); };