Added more MP4 Suport
This commit is contained in:
parent
b1ca9f48ec
commit
2c7df929c2
@ -43,7 +43,7 @@ abstract class Post_ImageStore_Base
|
|||||||
{
|
{
|
||||||
if (is_file($this->file_path()))
|
if (is_file($this->file_path()))
|
||||||
@unlink($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()))
|
if (file_exists($this->preview_path()))
|
||||||
@unlink($this->preview_path());
|
@unlink($this->preview_path());
|
||||||
if (file_exists($this->sample_path()))
|
if (file_exists($this->sample_path()))
|
||||||
@ -64,7 +64,7 @@ abstract class Post_ImageStore_Base
|
|||||||
|
|
||||||
// chmod($this->file_path(), 0777);
|
// chmod($this->file_path(), 0777);
|
||||||
|
|
||||||
if ($this->_post->image()) {
|
if ($this->_post->image() or $this->_post->video()) {
|
||||||
$this->_create_dirs($this->preview_path());
|
$this->_create_dirs($this->preview_path());
|
||||||
rename($this->_post->tempfile_preview_path(), $this->preview_path());
|
rename($this->_post->tempfile_preview_path(), $this->preview_path());
|
||||||
// chmod($this->preview_path(), 0777);
|
// chmod($this->preview_path(), 0777);
|
||||||
|
@ -16,7 +16,7 @@ class Post_ImageStore_LocalFlat extends Post_ImageStore_Base
|
|||||||
|
|
||||||
public function preview_path()
|
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";
|
return Rails::root() . "/public/data/preview/".$this->_post->md5.".jpg";
|
||||||
else
|
else
|
||||||
return Rails::root() . "/public/download-preview.png";
|
return Rails::root() . "/public/download-preview.png";
|
||||||
@ -31,7 +31,7 @@ class Post_ImageStore_LocalFlat extends Post_ImageStore_Base
|
|||||||
{
|
{
|
||||||
if ($this->_post->status == "deleted")
|
if ($this->_post->status == "deleted")
|
||||||
return CONFIG()->url_base . "/deleted-preview.png";
|
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";
|
return CONFIG()->url_base . "/data/preview/".$this->_post->md5.".jpg";
|
||||||
else
|
else
|
||||||
return CONFIG()->url_base . "/download-preview.png";
|
return CONFIG()->url_base . "/download-preview.png";
|
||||||
|
@ -16,7 +16,7 @@ class Post_ImageStore_LocalHierarchy extends Post_ImageStore_Base
|
|||||||
|
|
||||||
public function preview_path()
|
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";
|
return Rails::root() . "/public/data/preview/" . $this->_file_hierarchy() . "/" .$this->_post->md5.".jpg";
|
||||||
else
|
else
|
||||||
return Rails::root() . "/public/download-preview.png";
|
return Rails::root() . "/public/download-preview.png";
|
||||||
@ -31,7 +31,7 @@ class Post_ImageStore_LocalHierarchy extends Post_ImageStore_Base
|
|||||||
{
|
{
|
||||||
if ($this->_post->status == "deleted")
|
if ($this->_post->status == "deleted")
|
||||||
return CONFIG()->url_base . "/deleted-preview.png";
|
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";
|
return CONFIG()->url_base . "/data/preview/".$this->_post->md5.".jpg";
|
||||||
else
|
else
|
||||||
return CONFIG()->url_base . "/download-preview.png";
|
return CONFIG()->url_base . "/download-preview.png";
|
||||||
|
Reference in New Issue
Block a user