CC-2471:error when upload a duplicate file

- fixed
- Please read the comment on the ticket
This commit is contained in:
james 2011-06-30 13:08:45 -04:00
parent 8475326d96
commit b22a6268f2
2 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,9 @@ define('AIRTIME_VERSION', '1.9.0-beta2');
define('AIRTIME_COPYRIGHT_DATE', '2010-2011');
define('AIRTIME_REST_VERSION', '1.1');
// this constant is still used in somewhere
define('UI_MDATA_KEY_TITLE', 'track_title');
// Metadata Keys for files
define('MDATA_KEY_FILEPATH', 'filepath');
define('MDATA_KEY_MD5', 'md5');

View File

@ -805,7 +805,7 @@ class StoredFile {
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": ' . $duplicate->getMessage() .'}}');
}
if (file_exists($duplicate->getFilePath())) {
$duplicateName = $duplicate->getMetadataValue(UI_MDATA_KEY_TITLE);
$duplicateName = $duplicate->getMetadataValue("UI_MDATA_KEY_TITLE");
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "An identical audioclip named ' . $duplicateName . ' already exists in the storage server."}}');
}
}