Fixed problem with the Scratchpad not seeing the metadata.

This commit is contained in:
paul.baranowski 2010-09-14 16:19:12 -04:00
parent 59dc0dbd99
commit 30adbc2793

View file

@ -331,7 +331,7 @@ class StoredFile {
* @var int * @var int
*/ */
private $currentlyaccessing; private $currentlyaccessing;
/** /**
* @var int * @var int
*/ */
@ -393,6 +393,10 @@ class StoredFile {
$this->md = $this->loadMetadata(); $this->md = $this->loadMetadata();
} }
/**
* GUNID needs to be set before you call this function.
*
*/
public function loadMetadata() public function loadMetadata()
{ {
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
@ -630,6 +634,7 @@ class StoredFile {
} else { // fallback } else { // fallback
$storedFile = new StoredFile($gunid); $storedFile = new StoredFile($gunid);
} }
$storedFile->loadMetadata();
$storedFile->gunidBigint = $row['gunid_bigint']; $storedFile->gunidBigint = $row['gunid_bigint'];
//$storedFile->md->gunidBigint = $row['gunid_bigint']; //$storedFile->md->gunidBigint = $row['gunid_bigint'];
$storedFile->md["gunid"] = $row['gunid_bigint']; $storedFile->md["gunid"] = $row['gunid_bigint'];
@ -1153,33 +1158,33 @@ class StoredFile {
} }
return TRUE; return TRUE;
} }
/** /**
* Returns gunIds of the playlists the stored file is in. * Returns gunIds of the playlists the stored file is in.
*/ */
public function getPlaylists() { public function getPlaylists() {
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
$_SESSION['delete'] = "gunid: " . $this->gunid; $_SESSION['delete'] = "gunid: " . $this->gunid;
$sql = "SELECT gunid " $sql = "SELECT gunid "
." FROM ".$CC_CONFIG['mdataTable'] ." FROM ".$CC_CONFIG['mdataTable']
." WHERE object='{$this->gunid}'"; ." WHERE object='{$this->gunid}'";
$_SESSION['delete'] = $sql; $_SESSION['delete'] = $sql;
$playlists = $CC_DBC->getAll($sql); $playlists = $CC_DBC->getAll($sql);
return $playlists; return $playlists;
} }
public function isScheduled() { public function isScheduled() {
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
$sql = "SELECT * " $sql = "SELECT * "
." FROM ".$CC_CONFIG['scheduleTable'] ." FROM ".$CC_CONFIG['scheduleTable']
." WHERE ends > now() and playlist=x'{$this->gunid}'::bigint"; ." WHERE ends > now() and playlist=x'{$this->gunid}'::bigint";
$scheduled = $CC_DBC->getAll($sql); $scheduled = $CC_DBC->getAll($sql);
return $scheduled; return $scheduled;
} }