SAAS-596: Store file size and hash in database

Have pypo fetch the file size and md5, if necessary, and make request to
Airtime to set these values
This commit is contained in:
drigato 2015-02-24 11:00:41 -05:00
parent 47a7b0245e
commit be7a6854f0
3 changed files with 47 additions and 7 deletions

View file

@ -564,7 +564,10 @@ SQL;
public function getFileSize()
{
$filesize = $this->_file->getFileSize();
if ($filesize <= 0) {
// It's OK for the file size to be zero. Pypo will make a request to Airtime and update
// the file size and md5 hash if they are not set.
if ($filesize < 0) {
throw new Exception ("Could not determine filesize for file id: ".$this->_file->getDbId().". Filesize: ".$filesize);
}
return $filesize;