more edl work

This commit is contained in:
Sundog Jones 2024-09-16 16:24:06 -04:00
parent 7af76bb66b
commit 5f19650e90

View File

@ -508,6 +508,7 @@
template_clone.querySelector('input[name="media_item_edl_inpoint"]').value = formatted_inpoint;
template_clone.querySelector('input[name="media_item_edl_outpoint"]').value = formatted_outpoint;
template_clone.firstElementChild.setAttribute("data-duration", media_item_element.getAttribute("data-duration"));
template_clone.firstElementChild.setAttribute("data-media-id", media_item_element.getAttribute("data-id"));
target.innerHTML = "";
target.appendChild(template_clone);
fetch_item_tags(item_id);
@ -561,6 +562,7 @@
const payload = {};
const inpoint = document.querySelector("#media_item_edl_inpoint_listitem").getAttribute("data-start");
const outpoint = document.querySelector("#media_item_edl_outpoint_listitem").getAttribute("data-stop");
payload.media_id = document.querySelector("#media_library_details > .media_item_details").getAttribute("data-media-id");
payload.inpoint = inpoint || "0";
payload.outpoint = outpoint || document.querySelector("#media_library_details > .media_item_details").getAttribute("data-duration");
payload.inserts = [];
@ -571,7 +573,18 @@
});
console.log("preparing to save edl:");
console.dir(payload);
console.dir(e.target.parentNode.parentNode.firstElementChild.dataset);
fetch(api_url, {
method: "POST",
body: payload,
})
.then((response) => {
if (response.ok) {
response.json().then((payload) => {
// TODO: repopulate based on returned data
console.dir(payload);
});
}
});
});
}