This commit is contained in:
Duncan Sommerville 2014-11-19 15:21:14 -05:00
commit c627342e28
104 changed files with 31315 additions and 20071 deletions

View file

@ -1112,9 +1112,12 @@ class Application_Model_Scheduler
$removedItems = CcScheduleQuery::create()->findPks($scheduledIds);
//check to make sure all items selected are up to date
foreach ($removedItems as $removedItem) {
// This array is used to keep track of every show instance that was
// effected by the track deletion. It will be used later on to
// remove gaps in the schedule and adjust crossfade times.
$effectedInstanceIds = array();
foreach ($removedItems as $removedItem) {
$instance = $removedItem->getCcShowInstances($this->con);
//check if instance is linked and if so get the schedule items
@ -1122,25 +1125,22 @@ class Application_Model_Scheduler
if (!$cancelShow && $instance->getCcShow()->isLinked()) {
//returns all linked instances if linked
$ccShowInstances = $this->getInstances($instance->getDbId());
$instanceIds = array();
foreach ($ccShowInstances as $ccShowInstance) {
$instanceIds[] = $ccShowInstance->getDbId();
}
/*
* Find all the schedule items that are in the same position
* as the selected item by the user.
* The position of each track is the same across each linked instance
*/
$effectedInstanceIds = array_merge($effectedInstanceIds, $instanceIds);
// Delete the same track, represented by $removedItem, in
// each linked show instance.
$itemsToDelete = CcScheduleQuery::create()
->filterByDbPosition($removedItem->getDbPosition())
->filterByDbInstanceId($instanceIds, Criteria::IN)
->find();
foreach ($itemsToDelete as $item) {
if (!$removedItems->contains($item)) {
$removedItems->append($item);
}
}
->filterByDbId($removedItem->getDbId(), Criteria::NOT_EQUAL)
->delete($this->con);
}
//check to truncate the currently playing item instead of deleting it.
if ($removedItem->isCurrentItem($this->epochNow)) {
@ -1165,29 +1165,11 @@ class Application_Model_Scheduler
} else {
$removedItem->delete($this->con);
}
// update is_scheduled in cc_files but only if
// the file is not scheduled somewhere else
$fileId = $removedItem->getDbFileId();
// check if the removed item is scheduled somewhere else
$futureScheduledFiles = Application_Model_Schedule::getAllFutureScheduledFiles();
if (!is_null($fileId) && !in_array($fileId, $futureScheduledFiles)) {
$db_file = CcFilesQuery::create()->findPk($fileId, $this->con);
$db_file->setDbIsScheduled(false)->save($this->con);
}
}
Application_Model_StoredFile::updatePastFilesIsScheduled();
if ($adjustSched === true) {
//get the show instances of the shows we must adjust times for.
foreach ($removedItems as $item) {
$instance = $item->getDBInstanceId();
if (!in_array($instance, $showInstances)) {
$showInstances[] = $instance;
}
}
foreach ($showInstances as $instance) {
foreach ($effectedInstanceIds as $instance) {
$this->removeGaps($instance);
$this->calculateCrossfades($instance);
}
@ -1195,7 +1177,7 @@ class Application_Model_Scheduler
//update the status flag in cc_schedule.
$instances = CcShowInstancesQuery::create()
->filterByPrimaryKeys($showInstances)
->filterByPrimaryKeys($effectedInstanceIds)
->find($this->con);
foreach ($instances as $instance) {

View file

@ -1137,7 +1137,6 @@ SELECT s.name,
s.genre,
s.id,
si.id AS instance_id,
si.description AS instance_description,
si.record,
s.url,
s.image_path,
@ -1226,7 +1225,6 @@ SELECT si.starts AS start_timestamp,
s.description,
s.id,
si.id AS instance_id,
si.description AS instance_description,
si.record,
s.url,
s.image_path,
@ -1273,7 +1271,6 @@ SQL;
$results['previousShow'][0] = array(
"id" => $rows[$i-1]['id'],
"instance_id" => $rows[$i-1]['instance_id'],
"instance_description" => $rows[$i-1]['instance_description'],
"name" => $rows[$i-1]['name'],
"description" => $rows[$i-1]['description'],
"url" => $rows[$i-1]['url'],
@ -1292,7 +1289,6 @@ SQL;
$results['nextShow'][0] = array(
"id" => $rows[$i+1]['id'],
"instance_id" => $rows[$i+1]['instance_id'],
"instance_description" => $rows[$i+1]['instance_description'],
"name" => $rows[$i+1]['name'],
"description" => $rows[$i+1]['description'],
"url" => $rows[$i+1]['url'],
@ -1335,7 +1331,6 @@ SQL;
$results['previousShow'][0] = array(
"id" => $rows[$previousShowIndex]['id'],
"instance_id" => $rows[$previousShowIndex]['instance_id'],
"instance_description" => $rows[$previousShowIndex]['instance_description'],
"name" => $rows[$previousShowIndex]['name'],
"description" => $rows[$previousShowIndex]['description'],
"start_timestamp" => $rows[$previousShowIndex]['start_timestamp'],

View file

@ -355,7 +355,8 @@ SQL;
{
$exists = false;
try {
$exists = file_exists($this->getFilePath());
$filePath = $this->getFilePath();
$exists = (file_exists($this->getFilePath()) && !is_dir($filePath));
} catch (Exception $e) {
return false;
}
@ -369,9 +370,7 @@ SQL;
*
*/
public function delete()
{
$filepath = $this->getFilePath();
{
// Check if the file is scheduled to be played in the future
if (Application_Model_Schedule::IsFileScheduledInTheFuture($this->getId())) {
throw new DeleteScheduledFileException();
@ -389,20 +388,21 @@ SQL;
assert($music_dir);
$type = $music_dir->getType();
if (file_exists($filepath) && $type == "stor") {
try {
//Update the user's disk usage
Application_Model_Preference::updateDiskUsage(-1 * abs(filesize($filepath)));
unlink($filepath);
} catch (Exception $e) {
Logging::error($e->getMessage());
return;
}
}
Logging::info($_SERVER["HTTP_HOST"].": User ".$user->getLogin()." is deleting file: ".$this->_file->getDbTrackTitle()." - file id: ".$this->_file->getDbId());
try {
if ($this->existsOnDisk() && $type == "stor") {
$filepath = $this->getFilePath();
//Update the user's disk usage
Application_Model_Preference::updateDiskUsage(-1 * abs(filesize($filepath)));
unlink($filepath);
}
} catch (Exception $e) {
Logging::warning($e->getMessage());
//If the file didn't exist on disk, that's fine, we still want to
//remove it from the database, so we continue here.
}
// need to explicitly update any playlist's and block's length
// that contains the file getting deleted
$fileId = $this->_file->getDbId();
@ -420,8 +420,7 @@ SQL;
$bl->save();
}
// We were setting file_exists to false and leaving it at that
// but we should actually delete the file
//We actually do want to delete the file from the database here
$this->_file->delete();
}
@ -498,11 +497,15 @@ SQL;
$music_dir = Application_Model_MusicDir::getDirByPK($this->
_file->getDbDirectory());
if (!$music_dir) {
throw new Exception("Invalid music_dir for file in database.");
throw new Exception(_("Invalid music_dir for file in database."));
}
$directory = $music_dir->getDirectory();
$filepath = $this->_file->getDbFilepath();
if (!$filepath) {
throw new Exception(sprintf(_("Blank file path for file %s (id: %s) in database."), $this->_file->getDbTrackTitle(), $this->getId()));
}
return Application_Common_OsPath::join($directory, $filepath);
}

View file

@ -237,7 +237,7 @@ class Rest_MediaController extends Zend_Rest_Controller
//as a foreign key to cc_music_dirs.
if (isset($requestData["full_path"])) {
$fileSizeBytes = filesize($requestData["full_path"]);
if ($fileSizeBytes === false)
if (!isset($fileSizeBytes) || $fileSizeBytes === false)
{
$file->setDbImportStatus(self::IMPORT_STATUS_FAILED)->save();
$this->fileNotFoundResponse();
@ -280,8 +280,7 @@ class Rest_MediaController extends Zend_Rest_Controller
{
return;
}
$id = $this->getId();
if (!$id) {
return;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,26 @@
# LANGUAGE (xx_XX) translation for Airtime.
# Copyright (C) 2012 Sourcefabric
# This file is distributed under the same license as the Airtime package.
# Sourcefabric <contact@sourcefabric.org>, 2012.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Airtime 2.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-11-11 18:14-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:7
msgid "<b>Thank you!</b> Your plan has been updated and you will be invoiced during your next billing cycle."
msgstr ""
#: airtime_mvc/application/views/scripts/billing/invoices.phtml:11
msgid "Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button."
msgstr ""