From 5bd3371ec24b68488eef85b38ffafa70da1a418e Mon Sep 17 00:00:00 2001 From: drigato Date: Tue, 17 Feb 2015 16:51:25 -0500 Subject: [PATCH] SAAS-596: Store file size and hash in database Removed getFileSize from CloudFile.php since it can call the parent function. Moved setting filesize metadata from cloud_storage_uploader. --- airtime_mvc/application/models/airtime/CloudFile.php | 8 -------- .../airtime_analyzer/cloud_storage_uploader.py | 5 +---- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/airtime_mvc/application/models/airtime/CloudFile.php b/airtime_mvc/application/models/airtime/CloudFile.php index 1a5b1798c..fdc609ffc 100644 --- a/airtime_mvc/application/models/airtime/CloudFile.php +++ b/airtime_mvc/application/models/airtime/CloudFile.php @@ -44,14 +44,6 @@ class CloudFile extends BaseCloudFile return $this->proxyStorageBackend->getAbsoluteFilePath($this->getResourceId()); } - /** - * Returns the file size in bytes. - */ - public function getFileSize() - { - return $this->getDbFilesize(); - } - public function getFilename() { return $this->getDbFilepath(); diff --git a/python_apps/airtime_analyzer/airtime_analyzer/cloud_storage_uploader.py b/python_apps/airtime_analyzer/airtime_analyzer/cloud_storage_uploader.py index 9337344b8..85f886de5 100644 --- a/python_apps/airtime_analyzer/airtime_analyzer/cloud_storage_uploader.py +++ b/python_apps/airtime_analyzer/airtime_analyzer/cloud_storage_uploader.py @@ -62,8 +62,7 @@ class CloudStorageUploader: metadata: ID3 tags and other metadata extracted from the audio file. Returns: - The metadata dictionary it received with three new keys: - filesize: The file's filesize in bytes. + The metadata dictionary it received with two new keys: filename: The file's filename. resource_id: The unique object name used to identify the objects on Amazon S3 @@ -95,8 +94,6 @@ class CloudStorageUploader: key.key = resource_id key.set_metadata('filename', file_base_name) key.set_contents_from_filename(audio_file_path) - - metadata["filesize"] = os.path.getsize(audio_file_path) # Remove file from organize directory try: