Skip to content

Commit

Permalink
feat: Handle complex location type
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed Jul 8, 2024
1 parent c165dc2 commit a978bd8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Sabre/PropFindPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
use Sabre\DAV\Tree;
use Sabre\DAV\Xml\Property\Complex;

class PropFindPlugin extends ServerPlugin {
public const ORIGINAL_NAME_PROPERTYNAME = '{http://nextcloud.org/ns}original-name';
Expand Down Expand Up @@ -130,6 +131,10 @@ public function handleUpdateProperties($path, PropPatch $propPatch): void {
$node = $this->tree->getNodeForPath($path);
if ($node instanceof AlbumRoot) {
$propPatch->handle(self::LOCATION_PROPERTYNAME, function ($location) use ($node) {
if ($location instanceof Complex) {
$location = $location->getXml();
}

$this->albumMapper->setLocation($node->getAlbum()->getAlbum()->getId(), $location);
return true;
});
Expand Down

0 comments on commit a978bd8

Please sign in to comment.