filescan by mimetype scan

This commit is contained in:
Bartek Przybylski 2012-03-09 16:45:57 +01:00
parent 84d6c53970
commit ca9b4e467f
1 changed files with 6 additions and 5 deletions

View File

@ -540,14 +540,15 @@ class OC_FileCache{
}elseif($root=='/'){ }elseif($root=='/'){
$root=''; $root='';
} }
$rootLen=strlen($root); $rootLen=strlen($root);
$root .= '%';
$user=OC_User::getUser(); $user=OC_User::getUser();
if(!$part2){ if(!$part2){
$query=OC_DB::prepare('SELECT path FROM *PREFIX*fscache WHERE mimepart=? AND user=?'); $query=OC_DB::prepare('SELECT path FROM *PREFIX*fscache WHERE mimepart=? AND user=? AND path LIKE ?');
$result=$query->execute(array($part1,$user)); $result=$query->execute(array($part1,$user, $root));
}else{ }else{
$query=OC_DB::prepare('SELECT path FROM *PREFIX*fscache WHERE mimetype=? AND user=?'); $query=OC_DB::prepare('SELECT path FROM *PREFIX*fscache WHERE mimetype=? AND user=? AND path LIKE ? ');
$result=$query->execute(array($part1.'/'.$part2,$user)); $result=$query->execute(array($part1.'/'.$part2,$user, $root));
} }
$names=array(); $names=array();
while($row=$result->fetchRow()){ while($row=$result->fetchRow()){