Files

Trait Files

package

OCA\Gallery\Controller

Methods

Generates shortened paths to the media files

fixPaths(array $files, string $folderPathFromRoot) : array

We only want to keep one folder between the current folder and the found media file /root/folder/sub1/sub2/file.ext becomes /root/folder/file.ext

Arguments

$files

array

$folderPathFromRoot

string

Response

array

Generates the download data

getDownload(integer $fileId, string|null $filename) : array|false

Arguments

$fileId

integer

the ID of the file of which we need a large preview of

$filename

string|null

Response

array|false

getFilesAndAlbums

getFilesAndAlbums(string $location, array $features, string $etag, array $mediatypes) : array
NoAdminRequired

Returns a list of all media files and albums available to the authenticated user

  • Authentication can be via a login/password or a token/(password)
  • For private galleries, it returns all media files, with the full path from the root folder For public galleries, the path starts from the folder the link gives access to (virtual root)
  • An exception is only caught in case something really wrong happens. As we don't test files before including them in the list, we may return some bad apples

Arguments

$location

string

a path representing the current album in the app

$features

array

the list of supported features

$etag

string

the last known etag in the client

$mediatypes

array

the list of supported media types

Response

array

<string,array<string,string|int>>|Http\JSONResponse

Properties

searchFolderService

searchFolderService : \OCA\Gallery\Service\SearchFolderService

configService

configService : \OCA\Gallery\Service\ConfigService

searchMediaService

searchMediaService : \OCA\Gallery\Service\SearchMediaService

downloadService

downloadService : \OCA\Gallery\Service\DownloadService

logger

logger : \OCP\ILogger
var

Type(s)

\OCP\ILogger