more edl work
This commit is contained in:
parent
cd8c1a7fc8
commit
11a3412732
8
edl.php
8
edl.php
@ -17,16 +17,16 @@ if (isset($_REQUEST['media_id']) && $_REQUEST['media_id'] !== "") {
|
|||||||
// record exists
|
// record exists
|
||||||
if (isset($_REQUEST['id'])) {
|
if (isset($_REQUEST['id'])) {
|
||||||
// update
|
// update
|
||||||
$update_query = $db->prepare("UPDATE media_edls SET edl_name = :edl_name, edl_contents = :edl_contents WHERE id = :id");
|
$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_name', $_REQUEST['edl_name']);
|
||||||
$update_query->bindValue(':edl_contents', $_REQUEST['edl_contents']);
|
$update_query->bindValue(':edl_definition', $_REQUEST['edl_definition']);
|
||||||
$update_query->bindValue(':id', $_REQUEST['id']);
|
$update_query->bindValue(':id', $_REQUEST['id']);
|
||||||
} else {
|
} else {
|
||||||
// insert
|
// insert
|
||||||
$update_query = $db->prepare("INSERT INTO media_edls (media_id, edl_name, edl_contents) VALUES (:media_id, :edl_name, :edl_contents)");
|
$update_query = $db->prepare("INSERT INTO media_edls (media_id, edl_name, edl_definition) VALUES (:media_id, :edl_name, :edl_definition)");
|
||||||
$update_query->bindValue(':media_id', $_REQUEST['id']);
|
$update_query->bindValue(':media_id', $_REQUEST['id']);
|
||||||
$update_query->bindValue(':edl_name', $_REQUEST['edl_name']);
|
$update_query->bindValue(':edl_name', $_REQUEST['edl_name']);
|
||||||
$update_query->bindValue(':edl_contents', $_REQUEST['edl_contents']);
|
$update_query->bindValue(':edl_definition', $_REQUEST['edl_definition']);
|
||||||
}
|
}
|
||||||
error_log($update_query->getSQL(true));
|
error_log($update_query->getSQL(true));
|
||||||
$update_result = $update_query->execute();
|
$update_result = $update_query->execute();
|
||||||
|
10
layout.html
10
layout.html
@ -559,18 +559,20 @@
|
|||||||
edl_save_button.addEventListener("click", (e) => {
|
edl_save_button.addEventListener("click", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const api_url = "edl.php";
|
const api_url = "edl.php";
|
||||||
|
const edl_definition = {};
|
||||||
const payload = {};
|
const payload = {};
|
||||||
const inpoint = document.querySelector("#media_item_edl_inpoint_listitem").getAttribute("data-start");
|
const inpoint = document.querySelector("#media_item_edl_inpoint_listitem").getAttribute("data-start");
|
||||||
const outpoint = document.querySelector("#media_item_edl_outpoint_listitem").getAttribute("data-stop");
|
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.media_id = document.querySelector("#media_library_details > .media_item_details").getAttribute("data-media-id");
|
||||||
payload.inpoint = inpoint || "0";
|
edl_definition.inpoint = inpoint || "0";
|
||||||
payload.outpoint = outpoint || document.querySelector("#media_library_details > .media_item_details").getAttribute("data-duration");
|
edl_definition.outpoint = outpoint || document.querySelector("#media_library_details > .media_item_details").getAttribute("data-duration");
|
||||||
payload.inserts = [];
|
edl_definition.inserts = [];
|
||||||
const list_parent = document.querySelector("#media_item_edl_list");
|
const list_parent = document.querySelector("#media_item_edl_list");
|
||||||
const current_items = list_parent.querySelectorAll("li.media_item_edl_insert");
|
const current_items = list_parent.querySelectorAll("li.media_item_edl_insert");
|
||||||
current_items.forEach((insertPoint) => {
|
current_items.forEach((insertPoint) => {
|
||||||
payload.inserts.push(insertPoint.getAttribute("data-timestamp"));
|
edl_definition.inserts.push(insertPoint.getAttribute("data-timestamp"));
|
||||||
});
|
});
|
||||||
|
payload.edl_definition = edl_definition;
|
||||||
console.log("preparing to save edl:");
|
console.log("preparing to save edl:");
|
||||||
console.dir(payload);
|
console.dir(payload);
|
||||||
fetch(api_url, {
|
fetch(api_url, {
|
||||||
|
Loading…
Reference in New Issue
Block a user