mirror of https://github.com/nextcloud/photos
Merge pull request #1599 from simonspa/p/fix-upload
Fix upload of pictures into album
This commit is contained in:
commit
1330f0059e
|
@ -101,7 +101,7 @@ class PreviewController extends Controller {
|
|||
|
||||
if (\count($nodes) === 0) {
|
||||
$receivedAlbums = $this->albumMapper->getAlbumsForCollaboratorIdAndFileId($user->getUID(), AlbumMapper::TYPE_USER, $fileId);
|
||||
$receivedAlbums = array_udiff($receivedAlbums, $checkedAlbums, fn ($a, $b) => strcmp($a->getId(), $b->getId()));
|
||||
$receivedAlbums = array_udiff($receivedAlbums, $checkedAlbums, fn ($a, $b) => ($a->getId() - $b->getId()));
|
||||
$nodes = $this->getFileIdForAlbums($fileId, $receivedAlbums);
|
||||
$checkedAlbums = array_merge($checkedAlbums, $receivedAlbums);
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ class PreviewController extends Controller {
|
|||
$userGroups = $this->groupManager->getUserGroupIds($user);
|
||||
foreach ($userGroups as $groupId) {
|
||||
$albumsForGroup = $this->albumMapper->getAlbumsForCollaboratorIdAndFileId($groupId, AlbumMapper::TYPE_GROUP, $fileId);
|
||||
$albumsForGroup = array_udiff($albumsForGroup, $checkedAlbums, fn ($a, $b) => strcmp($a->getId(), $b->getId()));
|
||||
$albumsForGroup = array_udiff($albumsForGroup, $checkedAlbums, fn ($a, $b) => ($a->getId() - $b->getId()));
|
||||
$nodes = $this->getFileIdForAlbums($fileId, $albumsForGroup);
|
||||
$checkedAlbums = array_merge($checkedAlbums, $receivedAlbums);
|
||||
if (\count($nodes) !== 0) {
|
||||
|
|
|
@ -95,10 +95,10 @@ class AlbumRoot implements ICollection, ICopyTarget {
|
|||
[$photosLocation, $userFolder] = $this->getPhotosLocationInfo();
|
||||
|
||||
try {
|
||||
$photosFolder = $this->userFolder->get($photosLocation);
|
||||
$photosFolder = $userFolder->get($photosLocation);
|
||||
} catch (NotFoundException $e) {
|
||||
// If the folder does not exists, create it
|
||||
$photosFolder = $this->userFolder->newFolder($photosLocation);
|
||||
$photosFolder = $userFolder->newFolder($photosLocation);
|
||||
}
|
||||
|
||||
// If the node is not a folder, we throw
|
||||
|
|
Loading…
Reference in New Issue