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 <[email protected]>
  • Loading branch information
artonge authored and backportbot[bot] committed Jul 8, 2024
1 parent 945347b commit ddf6c3f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Sabre/Album/PropFindPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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 @@ -154,6 +155,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 ddf6c3f

Please sign in to comment.