[VD:OneDrive] re-fix problem of not show thumbnail of new items

c.f d38bc4fa47
This commit is contained in:
nao-pon
2017-11-21 17:16:14 +09:00
parent 6895097b43
commit fbdaae5143
+22 -1
View File
@@ -436,7 +436,7 @@ class elFinderVolumeOneDrive extends elFinderVolumeDriver
if ($raw->thumbnails[0]->small->url) {
$stat['tmb'] = substr($raw->thumbnails[0]->small->url, 8); // remove "https://"
}
} else if (!empty($raw->file->processingMetadata)) {
} elseif (!empty($raw->file->processingMetadata)) {
$stat['tmb'] = '1';
}
}
@@ -949,6 +949,27 @@ class elFinderVolumeOneDrive extends elFinderVolumeDriver
**/
protected function createTmb($path, $stat)
{
if ($this->options['useApiThumbnail']) {
if (func_num_args() > 2) {
list(, , $count) = func_get_args();
} else {
$count = 0;
}
if ($count < 10) {
if (isset($stat['tmb']) && $stat['tmb'] != '1') {
return $stat['tmb'];
} else {
sleep(2);
elFinder::extendTimeLimit();
$this->clearcache();
$stat = $this->stat($path);
return $this->createTmb($path, $stat, ++$count);
}
}
return false;
}
if (!$stat || !$this->canCreateTmb($path, $stat)) {
return false;
}