Merge pull request #251 from nextcloud/fixed-updatePhotoByFileJob
Fixed update photo by file job
This commit is contained in:
Коммит
96aacd1d19
15
js/script.js
15
js/script.js
|
@ -195,7 +195,20 @@
|
|||
$('#display-slider').prop('checked', true);
|
||||
}
|
||||
|
||||
if (optionsValues.hasOwnProperty('mapboxAPIKEY') && optionsValues.mapboxAPIKEY !== '') {
|
||||
//detect Webgl
|
||||
var canvas = document.createElement('canvas');
|
||||
var experimental = false;
|
||||
var gl;
|
||||
|
||||
try { gl = canvas.getContext("webgl"); }
|
||||
catch (x) { gl = null; }
|
||||
|
||||
if (gl == null) {
|
||||
try { gl = canvas.getContext("experimental-webgl"); experimental = true; }
|
||||
catch (x) { gl = null; }
|
||||
}
|
||||
|
||||
if (optionsValues.hasOwnProperty('mapboxAPIKEY') && optionsValues.mapboxAPIKEY !== '' && gl == null) {
|
||||
// change "button" layers
|
||||
delete mapController.baseLayers['OpenStreetMap'];
|
||||
delete mapController.baseLayers['ESRI Aerial'];
|
||||
|
|
|
@ -24,6 +24,11 @@ use OCA\Maps\Service\PhotofilesService;
|
|||
|
||||
class AddPhotoJob extends QueuedJob {
|
||||
|
||||
/** @var PhotofilesService */
|
||||
private $photofilesService;
|
||||
|
||||
/** @var IRootFolder */
|
||||
private $root;
|
||||
|
||||
/**
|
||||
* UserInstallScanJob constructor.
|
||||
|
|
|
@ -17,13 +17,18 @@ use \OCP\BackgroundJob\IJobList;
|
|||
use \OCP\AppFramework\Utility\ITimeFactory;
|
||||
use OCP\IUserManager;
|
||||
use OCP\IConfig;
|
||||
use OCP\Files\IRootFolder;
|
||||
|
||||
use OCA\Maps\Service\PhotofilesService;
|
||||
|
||||
|
||||
class UpdatePhotoByFileJob extends QueuedJob {
|
||||
|
||||
private $jobList;
|
||||
/** @var PhotofilesService */
|
||||
private $photofilesService;
|
||||
|
||||
/** @var IRootFolder */
|
||||
private $root;
|
||||
|
||||
/**
|
||||
* UserInstallScanJob constructor.
|
||||
|
@ -34,9 +39,11 @@ class UpdatePhotoByFileJob extends QueuedJob {
|
|||
* @param PhotofilesService $photofilesService
|
||||
*/
|
||||
public function __construct(ITimeFactory $timeFactory,
|
||||
IRootFolder $root,
|
||||
PhotofilesService $photofilesService) {
|
||||
parent::__construct($timeFactory);
|
||||
$this->photofilesService = $photofilesService;
|
||||
$this->root = $root;
|
||||
}
|
||||
|
||||
public function run($arguments) {
|
||||
|
|
|
@ -93,7 +93,7 @@ class GeophotoService {
|
|||
$file_object->type = $file->getType();
|
||||
$file_object->mime = $file->getMimetype();
|
||||
$file_object->lastmod = $file->getMTime();
|
||||
$file_object->size = $file->getSize;
|
||||
$file_object->size = $file->getSize();
|
||||
$file_object->path = $path;
|
||||
$file_object->hasPreview = in_array($cacheEntry->getMimeType(), $previewEnableMimetypes);
|
||||
$filesById[] = $file_object;
|
||||
|
|
Загрузка…
Ссылка в новой задаче