bring single instance file storage to dav and cloud uploaded photos

This commit is contained in:
redmatrix
2015-06-27 16:36:30 -07:00
parent b43c0bc471
commit 8d84472b4c
2 changed files with 28 additions and 8 deletions

View File

@@ -297,8 +297,18 @@ class RedDirectory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
}
if($is_photo) {
$album = '';
if($this->folder_hash) {
$f1 = q("select filename from attach WHERE hash = '%s' AND uid = %d",
dbesc($this->folder_hash),
intval($c[0]['channel_id'])
);
if($f1)
$album = $f1[0]['filename'];
}
require_once('include/photos.php');
$args = array( 'data' => @file_get_contents($f), 'resource_id' => $hash);
$args = array( 'resource_id' => $hash, 'album' => $album, 'os_path' => $f, 'filename' => $name, 'getimagesize' => $x);
$p = photo_upload($c[0],get_app()->get_observer(),$args);
}