SAAS-1071 - more work on celery backend for podcasts; add upgrade to make file_id field in third_party_track_references nullable
This commit is contained in:
parent
a24565669b
commit
43e9fb59ce
11 changed files with 127 additions and 58 deletions
|
@ -29,15 +29,14 @@ abstract class Application_Service_ThirdPartyService {
|
|||
*/
|
||||
public function createTrackReference($fileId) {
|
||||
// First, check if the track already has an entry in the database
|
||||
$ref = ThirdPartyTrackReferencesQuery::create()
|
||||
// If the file ID given is null, create a new reference
|
||||
$ref = is_null($fileId) ? null : ThirdPartyTrackReferencesQuery::create()
|
||||
->filterByDbService(static::$_SERVICE_NAME)
|
||||
->findOneByDbFileId($fileId);
|
||||
if (is_null($ref)) {
|
||||
$ref = new ThirdPartyTrackReferences();
|
||||
}
|
||||
$ref->setDbService(static::$_SERVICE_NAME);
|
||||
// TODO: implement service-specific statuses?
|
||||
// $ref->setDbStatus(CELERY_PENDING_STATUS);
|
||||
$ref->setDbFileId($fileId);
|
||||
$ref->save();
|
||||
return $ref->getDbId();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue