diff --git a/lib/Service/IRecommendation.php b/lib/Service/IRecommendation.php index 080fd600..8512fa16 100644 --- a/lib/Service/IRecommendation.php +++ b/lib/Service/IRecommendation.php @@ -24,4 +24,6 @@ public function hasPreview(): bool; public function setHasPreview(bool $state); public function getReason(): string; + + public function getEtag(): string; } diff --git a/lib/Service/RecommendedFile.php b/lib/Service/RecommendedFile.php index c8c3d30b..980967b7 100644 --- a/lib/Service/RecommendedFile.php +++ b/lib/Service/RecommendedFile.php @@ -21,6 +21,7 @@ class RecommendedFile implements IRecommendation { private int $timestamp; private string $reason; private bool $hasPreview; + private string $etag; public function __construct(string $directory, Node $node, @@ -31,6 +32,7 @@ public function __construct(string $directory, $this->reason = $reason; $this->timestamp = $timestamp; $this->hasPreview = false; + $this->etag = $node->getEtag(); } public function getId(): string { @@ -53,6 +55,10 @@ public function getReason(): string { return $this->reason; } + public function getEtag(): string { + return $this->etag; + } + public function hasPreview(): bool { return $this->hasPreview; } @@ -75,6 +81,7 @@ public function jsonSerialize() { 'mimeType' => $this->node->getMimetype(), 'hasPreview' => $this->hasPreview(), 'reason' => $this->getReason(), + 'etag' => $this->getEtag(), ]; } }