1
0
Fork 0
mirror of https://github.com/Yetangitu/owncloud-apps.git synced 2025-10-02 14:49:17 +02:00

files_opds: v0.6.8, implement preview provider using IPreview, only works from OC8.1 and onwards!

This commit is contained in:
frankdelange 2015-08-07 01:42:50 +02:00
parent 5734bedf41
commit 301e6507af
4 changed files with 10 additions and 7 deletions

View file

@ -10,12 +10,14 @@
* later.
*/
namespace OC\Preview;
namespace OCA\Files_Opds;
use OCP\Preview\IProvider;
/**
* Epub preview - returns cover or null
*/
class Epub extends Provider {
class EpubPreview implements IProvider {
public function getMimeType() {
return '/application\/epub\+zip/';
@ -43,5 +45,8 @@ class Epub extends Provider {
return (($cover !== null) && $image->valid()) ? $image : false;
}
public function isAvailable(\OCP\Files\FileInfo $file) {
return $file->getSize() > 0;
}
}