Don't divide by zero if there are no photos in the Gallery.

This commit is contained in:
Bharat Mediratta
2009-05-12 04:22:05 +00:00
parent 8ae6a7a144
commit c397cc73be

View File

@@ -83,6 +83,9 @@ class exif_task_Core {
private static function _get_stats() {
$missing_exif = ORM::factory("exif_record")->where("dirty", 1)->count_all();
$total_items = ORM::factory("item")->where("type", "photo")->count_all();
if (!$total_items) {
return array(0, 0, 0);
}
return array($missing_exif, $total_items,
round(100 * (($total_items - $missing_exif) / $total_items)));
}