Skip to content
Snippets Groups Projects
Commit 19c7d9c3 authored by Robin Appelman's avatar Robin Appelman Committed by Arthur Schiwon
Browse files

Port Icewind's fix I

parent 588e1547
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,23 @@ class Legacy { ...@@ -79,7 +79,23 @@ class Legacy {
$query = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` WHERE `path` = ?'); $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` WHERE `path` = ?');
} }
$result = $query->execute(array($path)); $result = $query->execute(array($path));
return $result->fetchRow(); $data = $result->fetchRow();
$data['etag'] = $this->getEtag($data['path']);
return $data;
}
function getEtag($path) {
list(, $user, , $relativePath) = explode('/', $path, 4);
if (is_null($relativePath)) {
$relativePath = '';
}
$query = \OC_DB::prepare('SELECT `propertyvalue` FROM `*PREFIX*properties` WHERE `userid` = ? AND propertypath = ? AND propertyname = "{DAV:}getetag"');
$result = $query->execute(array($user, $relativePath));
if ($row = $result->fetchRow()) {
return trim($row['propertyvalue'], '"');
} else {
return '';
}
} }
/** /**
...@@ -91,6 +107,10 @@ class Legacy { ...@@ -91,6 +107,10 @@ class Legacy {
function getChildren($id) { function getChildren($id) {
$query = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` WHERE `parent` = ?'); $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` WHERE `parent` = ?');
$result = $query->execute(array($id)); $result = $query->execute(array($id));
return $result->fetchAll(); $data = $result->fetchAll();
foreach ($data as $i => $item) {
$data[$i]['etag'] = $this->getEtag($item['path']);
}
return $data;
} }
} }
...@@ -134,6 +134,7 @@ class Upgrade { ...@@ -134,6 +134,7 @@ class Upgrade {
*/ */
list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($data['path']); list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($data['path']);
if ($storage) { if ($storage) {
$newData['etag'] = $data['etag'];
$newData['path_hash'] = md5($internalPath); $newData['path_hash'] = md5($internalPath);
$newData['path'] = $internalPath; $newData['path'] = $internalPath;
$newData['storage'] = $this->getNumericId($storage); $newData['storage'] = $this->getNumericId($storage);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment