From 2c7df929c20ea8198d4fcf09ede5b14346c8cb89 Mon Sep 17 00:00:00 2001 From: Yukimi Kazari Date: Mon, 26 Dec 2016 15:16:27 -0500 Subject: [PATCH] Added more MP4 Suport --- app/models/Post/ImageStore/Base.php | 4 ++-- app/models/Post/ImageStore/LocalFlat.php | 4 ++-- app/models/Post/ImageStore/LocalHierarchy.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/Post/ImageStore/Base.php b/app/models/Post/ImageStore/Base.php index 1d718bd..c7501d0 100755 --- a/app/models/Post/ImageStore/Base.php +++ b/app/models/Post/ImageStore/Base.php @@ -43,7 +43,7 @@ abstract class Post_ImageStore_Base { if (is_file($this->file_path())) @unlink($this->file_path()); - if ($this->_post->image()) { + if ($this->_post->image() or $this->_post->video()) { if (file_exists($this->preview_path())) @unlink($this->preview_path()); if (file_exists($this->sample_path())) @@ -64,7 +64,7 @@ abstract class Post_ImageStore_Base // chmod($this->file_path(), 0777); - if ($this->_post->image()) { + if ($this->_post->image() or $this->_post->video()) { $this->_create_dirs($this->preview_path()); rename($this->_post->tempfile_preview_path(), $this->preview_path()); // chmod($this->preview_path(), 0777); diff --git a/app/models/Post/ImageStore/LocalFlat.php b/app/models/Post/ImageStore/LocalFlat.php index c0f846a..7188b06 100755 --- a/app/models/Post/ImageStore/LocalFlat.php +++ b/app/models/Post/ImageStore/LocalFlat.php @@ -16,7 +16,7 @@ class Post_ImageStore_LocalFlat extends Post_ImageStore_Base public function preview_path() { - if ($this->_post->image()) + if ($this->_post->image() or $this->_post->video()) return Rails::root() . "/public/data/preview/".$this->_post->md5.".jpg"; else return Rails::root() . "/public/download-preview.png"; @@ -31,7 +31,7 @@ class Post_ImageStore_LocalFlat extends Post_ImageStore_Base { if ($this->_post->status == "deleted") return CONFIG()->url_base . "/deleted-preview.png"; - elseif ($this->_post->image()) + elseif ($this->_post->image() or $this->_post->video()) return CONFIG()->url_base . "/data/preview/".$this->_post->md5.".jpg"; else return CONFIG()->url_base . "/download-preview.png"; diff --git a/app/models/Post/ImageStore/LocalHierarchy.php b/app/models/Post/ImageStore/LocalHierarchy.php index ec7c090..ce40247 100755 --- a/app/models/Post/ImageStore/LocalHierarchy.php +++ b/app/models/Post/ImageStore/LocalHierarchy.php @@ -16,7 +16,7 @@ class Post_ImageStore_LocalHierarchy extends Post_ImageStore_Base public function preview_path() { - if ($this->_post->image()) + if ($this->_post->image() or $this->_post->video()) return Rails::root() . "/public/data/preview/" . $this->_file_hierarchy() . "/" .$this->_post->md5.".jpg"; else return Rails::root() . "/public/download-preview.png"; @@ -31,7 +31,7 @@ class Post_ImageStore_LocalHierarchy extends Post_ImageStore_Base { if ($this->_post->status == "deleted") return CONFIG()->url_base . "/deleted-preview.png"; - elseif ($this->_post->image()) + elseif ($this->_post->image() or $this->_post->video()) return CONFIG()->url_base . "/data/preview/".$this->_post->md5.".jpg"; else return CONFIG()->url_base . "/download-preview.png";