Improve the publish service implementation

This commit is contained in:
Duncan Sommerville 2015-11-16 16:18:29 -05:00
parent 42e55f193c
commit 7707378c2b
5 changed files with 59 additions and 45 deletions

View file

@ -332,4 +332,18 @@ class Application_Service_SoundcloudService extends Application_Service_ThirdPar
$this->delete($fileId);
}
/**
* Fetch the publication status for the file with the given ID
*
* @param int $fileId the ID of the file to check
*
* @return int 1 if the file has been published,
* 0 if the file has yet to be published,
* -1 if the file is in a pending state,
* 2 if the source is unreachable (disconnected)
*/
public function getPublishStatus($fileId) {
if (!$this->hasAccessToken()) { return 2; }
return ($this->referenceExists($fileId));
}
}