From 50e5cc7949e08b025aa48a69efae599eb7c2e0f5 Mon Sep 17 00:00:00 2001 From: konradSC Date: Mon, 10 Dec 2018 11:30:02 -0500 Subject: [PATCH] Update recordings.lua (#3941) Keep recording descriptions when overwriting a slot. --- resources/install/scripts/recordings.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/resources/install/scripts/recordings.lua b/resources/install/scripts/recordings.lua index 9ea5896991..25e5f51e6d 100644 --- a/resources/install/scripts/recordings.lua +++ b/resources/install/scripts/recordings.lua @@ -156,6 +156,14 @@ session:execute("record", "'"..recordings_dir.."/"..recording_name.."' 10800 500 500"); end + --get the description of the previous recording + sql = "SELECT recording_description FROM v_recordings "; + sql = sql .. "where domain_uuid = :domain_uuid "; + sql = sql .. "and recording_filename = :recording_name "; + sql = sql .. "limit 1"; + local params = {domain_uuid = domain_uuid, recording_name = recording_name}; + local recording_description = dbh:first_value(sql, params) or '' + --delete the previous recording sql = "delete from v_recordings "; sql = sql .. "where domain_uuid = :domain_uuid "; @@ -172,6 +180,7 @@ table.insert(array, "recording_uuid, "); table.insert(array, "domain_uuid, "); table.insert(array, "recording_filename, "); + table.insert(array, "recording_description, "); if (storage_type == "base64") then table.insert(array, "recording_base64, "); end @@ -182,6 +191,7 @@ table.insert(array, ":recording_uuid, "); table.insert(array, ":domain_uuid, "); table.insert(array, ":recording_name, "); + table.insert(array, ":recording_description, "); if (storage_type == "base64") then table.insert(array, ":recording_base64, "); end @@ -193,6 +203,7 @@ recording_uuid = recording_uuid; domain_uuid = domain_uuid; recording_name = recording_name; + recording_description = recording_description; recording_base64 = recording_base64; };