From 6439bc9ad51d6a541d54504dd1ae75cd2b57a714 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Thu, 18 Jun 2015 13:32:43 -0400 Subject: [PATCH] Add timestamp on SoundCloud upload success --- airtime_mvc/application/services/SoundcloudService.php | 2 ++ .../application/services/ThirdPartyCeleryService.php | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/services/SoundcloudService.php b/airtime_mvc/application/services/SoundcloudService.php index 5ae0a734b..4aac783a7 100644 --- a/airtime_mvc/application/services/SoundcloudService.php +++ b/airtime_mvc/application/services/SoundcloudService.php @@ -102,6 +102,8 @@ class SoundcloudService extends ThirdPartyCeleryService implements OAuth2 { $ref->setDbService(static::$_SERVICE_NAME); // Only set the SoundCloud fields if the task was successful if ($status == CELERY_SUCCESS_STATUS) { + $utc = new DateTimeZone("UTC"); + $ref->setDbUploadTime(new DateTime("now", $utc)); // TODO: fetch any additional SoundCloud parameters we want to store $ref->setDbForeignId($track->id); // SoundCloud identifier } diff --git a/airtime_mvc/application/services/ThirdPartyCeleryService.php b/airtime_mvc/application/services/ThirdPartyCeleryService.php index ec3527545..5791c30ca 100644 --- a/airtime_mvc/application/services/ThirdPartyCeleryService.php +++ b/airtime_mvc/application/services/ThirdPartyCeleryService.php @@ -108,10 +108,10 @@ abstract class ThirdPartyCeleryService extends ThirdPartyService { * @throws PropelException */ public function updateTrackReference($trackId, $track, $status) { - $ref = CeleryTasksQuery::create() + $task = CeleryTasksQuery::create() ->findOneByDbTrackReference($trackId); - $ref->setDbStatus($status); - $ref->save(); + $task->setDbStatus($status); + $task->save(); } /**