CC-1799 : Live Studio Playout from media library (pytagsfs)

if a tag is edited by easytag, the change is now reflected in airtime database.
This commit is contained in:
Naomi 2011-04-28 18:02:40 -04:00 committed by martin
parent dbcfabfb76
commit 5be039d349
4 changed files with 59 additions and 18 deletions

View file

@ -543,16 +543,25 @@ class StoredFile {
public function replaceDbMetadata($p_values)
{
global $CC_CONFIG, $CC_DBC;
$data = array();
foreach ($p_values as $category => $value) {
$escapedValue = pg_escape_string($value);
$columnName = $category;
if (!is_null($columnName)) {
$sql = "UPDATE ".$CC_CONFIG["filesTable"]
." SET $columnName='$escapedValue'"
." WHERE gunid = '".$this->gunid."'";
$CC_DBC->query($sql);
$data[] = "$columnName='$escapedValue'";
}
}
$data = join(",", $data);
$sql = "UPDATE ".$CC_CONFIG["filesTable"]
." SET $data"
." WHERE gunid = '".$this->gunid."'";
$res = $CC_DBC->query($sql);
if (PEAR::isError($res)) {
$CC_DBC->query("ROLLBACK");
return $res;
}
}
public function clearMetadata()