diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-07-31 02:20:34 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-07-31 02:20:34 +0200 |
commit | 0bc16683e522f5c70629643a1b4737aed51a4516 (patch) | |
tree | 50668daca9d9706883c0ed36512468ee2441b7bb /lib | |
parent | 291d8c73f80e98fae9f858a9118409d546ebe640 (diff) | |
download | nextcloud-server-0bc16683e522f5c70629643a1b4737aed51a4516.tar.gz nextcloud-server-0bc16683e522f5c70629643a1b4737aed51a4516.zip |
dont show music results twice
Diffstat (limited to 'lib')
-rw-r--r-- | lib/search/provider/file.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/search/provider/file.php b/lib/search/provider/file.php index f84d098dd69..f3d235abdce 100644 --- a/lib/search/provider/file.php +++ b/lib/search/provider/file.php @@ -8,7 +8,17 @@ class OC_Search_Provider_File extends OC_Search_Provider{ if(OC_Filesystem::is_dir($file)){ $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'index.php?dir='.$file ),'Files'); }else{ - $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php?file='.$file ),'Files'); + $mime=OC_Filesystem::getMimeType($file); + $mimeBase=substr($mime,0,strpos($mime,'/')); + switch($mimeBase){ + case 'audio': + break; + case 'image': + $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php?file='.$file ),'Images'); + break; + default: + $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php?file='.$file ),'Files'); + } } } return $results; |