Add timestamp on SoundCloud upload success
This commit is contained in:
parent
02e0537be9
commit
6439bc9ad5
|
@ -102,6 +102,8 @@ class SoundcloudService extends ThirdPartyCeleryService implements OAuth2 {
|
||||||
$ref->setDbService(static::$_SERVICE_NAME);
|
$ref->setDbService(static::$_SERVICE_NAME);
|
||||||
// Only set the SoundCloud fields if the task was successful
|
// Only set the SoundCloud fields if the task was successful
|
||||||
if ($status == CELERY_SUCCESS_STATUS) {
|
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
|
// TODO: fetch any additional SoundCloud parameters we want to store
|
||||||
$ref->setDbForeignId($track->id); // SoundCloud identifier
|
$ref->setDbForeignId($track->id); // SoundCloud identifier
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,10 +108,10 @@ abstract class ThirdPartyCeleryService extends ThirdPartyService {
|
||||||
* @throws PropelException
|
* @throws PropelException
|
||||||
*/
|
*/
|
||||||
public function updateTrackReference($trackId, $track, $status) {
|
public function updateTrackReference($trackId, $track, $status) {
|
||||||
$ref = CeleryTasksQuery::create()
|
$task = CeleryTasksQuery::create()
|
||||||
->findOneByDbTrackReference($trackId);
|
->findOneByDbTrackReference($trackId);
|
||||||
$ref->setDbStatus($status);
|
$task->setDbStatus($status);
|
||||||
$ref->save();
|
$task->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue