diff options
author | Bharat Mediratta <bharat@menalto.com> | 2013-02-06 14:58:25 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2013-02-06 14:58:25 -0800 |
commit | d9273038b0a4a1e84edaf46d9b8e09925c421a4e (patch) | |
tree | f681bb91c8b5faf6e7b886e258e0850d432b8c21 | |
parent | aed006a92e858cb9ca66dd021c07c5d80586169f (diff) | |
parent | faa719551d68308be8a1c41d9cd6104604958593 (diff) |
Merge pull request #124 from shadlaws/fix_1991
#1991 - Add options to graphics::mark_dirty to specify type and/or mime type
-rw-r--r-- | modules/gallery/helpers/graphics.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 7c8e89d5..4df57fba 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -314,12 +314,19 @@ class graphics_Core { } /** - * Mark thumbnails and resizes as dirty. They will have to be rebuilt. + * Mark thumbnails and resizes as dirty. They will have to be rebuilt. Optionally, only those of + * a specified type and/or mime type can be marked (e.g. $type="movie" to rebuild movies only). */ - static function mark_dirty($thumbs, $resizes) { + static function mark_dirty($thumbs, $resizes, $type=null, $mime_type=null) { if ($thumbs || $resizes) { $db = db::build() ->update("items"); + if ($type) { + $db->where("type", "=", $type); + } + if ($mime_type) { + $db->where("mime_type", "=", $mime_type); + } if ($thumbs) { $db->set("thumb_dirty", 1); } |