Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<author mail="skjnldsv@protonmail.com">John Molakvoæ</author>
<namespace>Photos</namespace>
<category>multimedia</category>
<types>
<dav/>
</types>

<website>https://github.com/nextcloud/photos</website>
<bugs>https://github.com/nextcloud/photos/issues</bugs>
Expand All @@ -25,4 +28,13 @@
<order>1</order>
</navigation>
</navigations>

<sabre>
<collections>
<collection>OCA\Photos\Sabre\RootCollection</collection>
</collections>
<plugins>
<plugin>OCA\Photos\Sabre\Album\PropFindPlugin</plugin>
</plugins>
</sabre>
</info>
96 changes: 96 additions & 0 deletions lib/Album/AlbumFile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php

declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 Robin Appelman <robin@icewind.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

namespace OCA\Photos\Album;

use OC\Metadata\FileMetadata;

class AlbumFile {
private int $fileId;
private string $name;
private string $mimeType;
private int $size;
private int $mtime;
private string $etag;
private int $added;
/** @var array<int, FileMetadata> */
private array $metaData = [];

public function __construct(
int $fileId,
string $name,
string $mimeType,
int $size,
int $mtime,
string $etag,
int $added
) {
$this->fileId = $fileId;
$this->name = $name;
$this->mimeType = $mimeType;
$this->size = $size;
$this->mtime = $mtime;
$this->etag = $etag;
$this->added = $added;
}

public function getFileId(): int {
return $this->fileId;
}

public function getName(): string {
return $this->name;
}

public function getMimeType(): string {
return $this->mimeType;
}

public function getSize(): int {
return $this->size;
}

public function getMTime(): int {
return $this->mtime;
}

public function getEtag() {
return $this->etag;
}

public function setMetadata(string $key, FileMetadata $value): void {
$this->metaData[$key] = $value;
}

public function hasMetadata(string $key): bool {
return isset($this->metaData[$key]);
}

public function getMetadata(string $key): FileMetadata {
return $this->metaData[$key];
}

public function getAdded(): int {
return $this->added;
}
}
73 changes: 73 additions & 0 deletions lib/Album/AlbumInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php

declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 Robin Appelman <robin@icewind.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

namespace OCA\Photos\Album;

class AlbumInfo {
private int $id;
private string $userId;
private string $title;
private string $location;
private int $created;
private int $lastAdded;

public function __construct(
int $id,
string $userId,
string $title,
string $location,
int $created,
int $lastAdded
) {
$this->id = $id;
$this->userId = $userId;
$this->title = $title;
$this->location = $location;
$this->created = $created;
$this->lastAdded = $lastAdded;
}

public function getId(): int {
return $this->id;
}

public function getUserId(): string {
return $this->userId;
}

public function getTitle(): string {
return $this->title;
}

public function getLocation(): string {
return $this->location;
}

public function getCreated(): int {
return $this->created;
}

public function getLastAddedPhoto(): int {
return $this->lastAdded;
}
}
Loading