mirror of
https://github.com/Yetangitu/owncloud-apps.git
synced 2025-10-02 14:49:17 +02:00
reader: files_reader evolved with multiple format support (epub and cbr/cbz for now), session (position and preferences) store/restore and more
This commit is contained in:
parent
6e1bd38409
commit
57a76be890
81 changed files with 22806 additions and 0 deletions
80
reader/lib/Controller/MetadataController.php
Normal file
80
reader/lib/Controller/MetadataController.php
Normal file
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
/**
|
||||
* @author Frank de Lange
|
||||
* @copyright 2017 Frank de Lange
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
namespace OCA\Files_Reader\Controller;
|
||||
|
||||
use OCP\IRequest;
|
||||
use OCP\AppFramework\Controller;
|
||||
|
||||
use OCA\Files_Reader\Service\MetadataService;
|
||||
|
||||
class MetadataController extends Controller {
|
||||
|
||||
private $metadataService;
|
||||
|
||||
/**
|
||||
* @param string $AppName
|
||||
* @param IRequest $request
|
||||
* @param MetadataService $metadataService
|
||||
*/
|
||||
public function __construct($AppName,
|
||||
IRequest $request,
|
||||
MetadataService $metadataService ) {
|
||||
|
||||
parent::__construct($AppName, $request);
|
||||
$this->metadataService = $metadataService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief write metadata
|
||||
*
|
||||
* @NoAdminRequired
|
||||
*
|
||||
* @param int $fileId
|
||||
* @param string $value
|
||||
*
|
||||
* @return array|\OCP\AppFramework\Http\JSONResponse
|
||||
*/
|
||||
public function setAll($fileId, $value) {
|
||||
return $this->metadataService->setAll($fileId, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief return metadata item
|
||||
*
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* @param int $fileId
|
||||
* @param string $name
|
||||
*
|
||||
* @return array|\OCP\AppFramework\Http\JSONResponse
|
||||
*/
|
||||
public function get($fileId, $name) {
|
||||
return $this->metadataService->get($fileId, $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief write metadata item
|
||||
*
|
||||
* @NoAdminRequired
|
||||
*
|
||||
* @param int $fileId
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
*
|
||||
* @return array|\OCP\AppFramework\Http\JSONResponse
|
||||
*/
|
||||
public function set($fileId, $name, $value) {
|
||||
return $this->metadataService->set($fileId, $name, $value);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue