edl integration work
This commit is contained in:
parent
da339b3ddc
commit
efffc35f30
4
edl.php
4
edl.php
@ -17,12 +17,12 @@ if (isset($_REQUEST['media_id']) && $_REQUEST['media_id'] !== "") {
|
||||
|
||||
if ($result) {
|
||||
// record exists
|
||||
if (isset($_REQUEST['id'])) {
|
||||
if (isset($_REQUEST['edl_id'])) {
|
||||
// update
|
||||
$update_query = $db->prepare("UPDATE media_edls SET edl_name = :edl_name, edl_definition = :edl_definition WHERE id = :id");
|
||||
$update_query->bindValue(':edl_name', $_REQUEST['edl_name']);
|
||||
$update_query->bindValue(':edl_definition', $_REQUEST['edl_definition']);
|
||||
$update_query->bindValue(':id', $_REQUEST['id']);
|
||||
$update_query->bindValue(':id', $_REQUEST['edl_id']);
|
||||
} else {
|
||||
// insert
|
||||
$update_query = $db->prepare("INSERT INTO media_edls (media_id, edl_name, edl_definition) VALUES (:media_id, :edl_name, :edl_definition)");
|
||||
|
@ -604,13 +604,15 @@
|
||||
edl_definition.outpoint = outpoint || document.querySelector("#media_library_details > .media_item_details").getAttribute("data-duration");
|
||||
edl_definition.inserts = [];
|
||||
const list_parent = document.querySelector("#media_item_edl_list");
|
||||
|
||||
const edl_id = list_parent.getAttribute("data-edl-id") || null;
|
||||
const edl_name = list_parent.getAttribute("data-edl-name") || null;
|
||||
const current_items = list_parent.querySelectorAll("li.media_item_edl_insert");
|
||||
current_items.forEach((insertPoint) => {
|
||||
edl_definition.inserts.push(insertPoint.getAttribute("data-timestamp"));
|
||||
});
|
||||
payload.edl_definition = JSON.stringify(edl_definition);
|
||||
payload.edl_name = "default"; // TODO: handle multiple EDLs per media file later!
|
||||
payload.edl_name = edl_name || "default"; // TODO: handle this better once we have multiple EDL support
|
||||
if (edl_id) payload.edl_id = edl_id;
|
||||
console.log("preparing to save edl:");
|
||||
console.dir(payload);
|
||||
fetch(api_url, {
|
||||
|
Loading…
Reference in New Issue
Block a user