refactored addWatchedDir to use early return style

This commit is contained in:
Rudi Grinberg 2012-11-03 01:16:57 -04:00
parent 5d3aa68c72
commit 9c4f2e3298

View file

@ -246,7 +246,7 @@ SQL;
{ {
$res = self::addDir($p_path, "watched", $userAddedWatchedDir, $nestedWatch); $res = self::addDir($p_path, "watched", $userAddedWatchedDir, $nestedWatch);
if ($res['code'] == 0) { if ($res['code'] != 0) { return $res; }
//convert "linked" files (Airtime <= 1.8.2) to watched files. //convert "linked" files (Airtime <= 1.8.2) to watched files.
$propel_link_dir = CcMusicDirsQuery::create() $propel_link_dir = CcMusicDirsQuery::create()
@ -288,7 +288,6 @@ SQL;
$data = array(); $data = array();
$data["directory"] = $p_path; $data["directory"] = $p_path;
Application_Model_RabbitMq::SendMessageToMediaMonitor("new_watch", $data); Application_Model_RabbitMq::SendMessageToMediaMonitor("new_watch", $data);
}
return $res; return $res;
} }