From 8d84472b4cb85b50c314491e0706d80eb5b7de6d Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 27 Jun 2015 16:36:30 -0700 Subject: bring single instance file storage to dav and cloud uploaded photos --- include/RedDAV/RedDirectory.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'include/RedDAV/RedDirectory.php') diff --git a/include/RedDAV/RedDirectory.php b/include/RedDAV/RedDirectory.php index c41056ac9..1f7ba8927 100644 --- a/include/RedDAV/RedDirectory.php +++ b/include/RedDAV/RedDirectory.php @@ -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); } -- cgit v1.2.3