better flow in dispatchMetadata function
This commit is contained in:
parent
3948964e8d
commit
f5fa033207
|
@ -520,8 +520,6 @@ class ApiController extends Zend_Controller_Action
|
||||||
//File is not in database anymore.
|
//File is not in database anymore.
|
||||||
if (is_null($file)) {
|
if (is_null($file)) {
|
||||||
$return_hash['error'] = _("File does not exist in Airtime.");
|
$return_hash['error'] = _("File does not exist in Airtime.");
|
||||||
|
|
||||||
return $return_hash;
|
|
||||||
}
|
}
|
||||||
//Updating a metadata change.
|
//Updating a metadata change.
|
||||||
else {
|
else {
|
||||||
|
@ -547,8 +545,6 @@ class ApiController extends Zend_Controller_Action
|
||||||
$return_hash['error'] = _("File doesn't exist in Airtime.");
|
$return_hash['error'] = _("File doesn't exist in Airtime.");
|
||||||
Logging::warn("Attempt to delete file that doesn't exist.
|
Logging::warn("Attempt to delete file that doesn't exist.
|
||||||
Path: '$filepath'");
|
Path: '$filepath'");
|
||||||
|
|
||||||
return $return_hash;
|
|
||||||
} else {
|
} else {
|
||||||
$file->deleteByMediaMonitor();
|
$file->deleteByMediaMonitor();
|
||||||
}
|
}
|
||||||
|
@ -561,11 +557,11 @@ class ApiController extends Zend_Controller_Action
|
||||||
$file->deleteByMediaMonitor();
|
$file->deleteByMediaMonitor();
|
||||||
}
|
}
|
||||||
$return_hash['success'] = 1;
|
$return_hash['success'] = 1;
|
||||||
|
|
||||||
return $return_hash;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($return_hash['error'])) {
|
||||||
$return_hash['fileid'] = is_null($file) ? '-1' : $file->getId();
|
$return_hash['fileid'] = is_null($file) ? '-1' : $file->getId();
|
||||||
|
}
|
||||||
$con->commit();
|
$con->commit();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Logging::warn("rolling back");
|
Logging::warn("rolling back");
|
||||||
|
|
Loading…
Reference in New Issue