32 lines
632 B
PHP
32 lines
632 B
PHP
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
namespace OCA\Retro\Preview;
|
||
|
|
||
|
use OCP\Files\File;
|
||
|
use OCP\Files\FileInfo;
|
||
|
use OCP\IImage;
|
||
|
use OCP\Image;
|
||
|
use OCP\Preview\IProviderV2;
|
||
|
|
||
|
abstract class Rom implements IProviderV2
|
||
|
{
|
||
|
protected string $console;
|
||
|
|
||
|
public function getMimeType(): string {
|
||
|
return sprintf('/application\/x-%s-rom/', $this->console);
|
||
|
}
|
||
|
|
||
|
public function isAvailable(FileInfo $file): bool {
|
||
|
return file_exists(sprintf('%s/../../assets/%s.png', __DIR__, $this->console));
|
||
|
}
|
||
|
|
||
|
public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage {
|
||
|
$image = new Image();
|
||
|
$image->loadFromFile();
|
||
|
|
||
|
return null;
|
||
|
}
|
||
|
}
|