Merge branch 'saas-dev' into saas-speedy
This commit is contained in:
commit
e86e1cb4ac
20 changed files with 553 additions and 55 deletions
|
@ -1453,4 +1453,44 @@ class Application_Model_Preference
|
|||
{
|
||||
return self::getValue("provisioning_status");
|
||||
}
|
||||
|
||||
public static function setTuneinEnabled($value)
|
||||
{
|
||||
self::setValue("tunein_enabled", $value);
|
||||
}
|
||||
|
||||
public static function getTuneinEnabled()
|
||||
{
|
||||
return self::getValue("tunein_enabled");
|
||||
}
|
||||
|
||||
public static function setTuneinPartnerKey($value)
|
||||
{
|
||||
self::setValue("tunein_partner_key", $value);
|
||||
}
|
||||
|
||||
public static function getTuneinPartnerKey()
|
||||
{
|
||||
return self::getValue("tunein_partner_key");
|
||||
}
|
||||
|
||||
public static function setTuneinPartnerId($value)
|
||||
{
|
||||
self::setValue("tunein_partner_id", $value);
|
||||
}
|
||||
|
||||
public static function getTuneinPartnerId()
|
||||
{
|
||||
return self::getValue("tunein_partner_id");
|
||||
}
|
||||
|
||||
public static function setTuneinStationId($value)
|
||||
{
|
||||
self::setValue("tunein_station_id", $value);
|
||||
}
|
||||
|
||||
public static function getTuneinStationId()
|
||||
{
|
||||
return self::getValue("tunein_station_id");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,12 +112,7 @@ class Application_Model_RabbitMq
|
|||
$data['original_filename'] = $originalFilename;
|
||||
$data['callback_url'] = $callbackUrl;
|
||||
$data['api_key'] = $apiKey;
|
||||
// Pass station name to the analyzer so we can set it with the file's
|
||||
// metadata before uploading it to the cloud. This isn't a requirement
|
||||
// for cloud storage, but put there as a safeguard, since all Airtime
|
||||
// Pro stations will share the same bucket.
|
||||
$data['station_domain'] = $stationDomain = Application_Model_Preference::GetStationName();
|
||||
|
||||
|
||||
// We add a prefix to the resource name so files are not all placed
|
||||
// under the root folder. We do this in case we need to restore a
|
||||
// customer's file/s; File restoration is done via the S3 Browser
|
||||
|
|
|
@ -56,6 +56,29 @@ SQL;
|
|||
|
||||
return $real_streams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array with 2 elements: artist and title name of the track that is currently playing.
|
||||
* Elements will be set to null if metadata is not set for those fields.
|
||||
*
|
||||
* Returns null if no track is currently playing.
|
||||
*
|
||||
* Data is based on GetPlayOrderRange() in this class.
|
||||
*/
|
||||
public static function getCurrentPlayingTrack()
|
||||
{
|
||||
$currentScheduleInfo = self::GetPlayOrderRange();
|
||||
if (empty($currentScheduleInfo["tracks"]["current"])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$currentTrackArray = explode(" - ", $currentScheduleInfo["tracks"]["current"]["name"]);
|
||||
$currentTrackMetadata = array(
|
||||
"artist" => empty($currentTrackArray[0]) ? null : urlencode($currentTrackArray[0]),
|
||||
"title" => empty($currentTrackArray[1]) ? null : urlencode($currentTrackArray[1])
|
||||
);
|
||||
return $currentTrackMetadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns data related to the scheduled items.
|
||||
|
|
|
@ -375,7 +375,7 @@ SQL;
|
|||
* Deletes the physical file from the local file system or from the cloud
|
||||
*
|
||||
*/
|
||||
public function delete()
|
||||
public function delete($quiet=false)
|
||||
{
|
||||
// Check if the file is scheduled to be played in the future
|
||||
if (Application_Model_Schedule::IsFileScheduledInTheFuture($this->_file->getCcFileId())) {
|
||||
|
@ -405,8 +405,12 @@ SQL;
|
|||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
//Just log the exception and continue.
|
||||
Logging::error($e);
|
||||
if ($quiet) {
|
||||
Logging::info($e);
|
||||
} else {
|
||||
//Just log the exception and continue.
|
||||
Logging::error($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue