summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-12-16 15:18:08 -0800
committerBharat Mediratta <bharat@menalto.com>2009-12-16 15:18:08 -0800
commit02b3c4e70478519e3baa7df80fefd19ebdd6e2e3 (patch)
tree34b3be65fd9534f285ae37e2ed9899f46e94d5b3 /modules
parentb4a35a8e2cc38a2d8aff2cf1ba16f4357aa1a52a (diff)
Adjust for the fact that movies have JPG thumbnails. Fixes ticket
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/models/item.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index d27e331b..96415b3d 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -157,7 +157,16 @@ class Item_Model extends ORM_MPTT {
@rename(VARPATH . "albums/$old_relative_path", VARPATH . "albums/$new_relative_path");
@rename(VARPATH . "resizes/$old_relative_path", VARPATH . "resizes/$new_relative_path");
- @rename(VARPATH . "thumbs/$old_relative_path", VARPATH . "thumbs/$new_relative_path");
+ if ($this->is_movie()) {
+ // Movie thumbnails have a .jpg extension
+ $old_relative_thumb_path = preg_replace("/...$/", "jpg", $old_relative_path);
+ $new_relative_thumb_path = preg_replace("/...$/", "jpg", $new_relative_path);
+ @rename(VARPATH . "thumbs/$old_relative_thumb_path",
+ VARPATH . "thumbs/$new_relative_thumb_path");
+ } else {
+ @rename(VARPATH . "thumbs/$old_relative_path", VARPATH . "thumbs/$new_relative_path");
+ }
+
$this->name = $new_name;
if ($this->is_album()) {