Added more MP4 Suport

This commit is contained in:
Yukimi Kazari 2016-12-26 15:16:27 -05:00
parent b1ca9f48ec
commit 2c7df929c2
3 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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";

View File

@ -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";