diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-08-26 15:17:39 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-08-28 19:32:52 +0200 |
commit | d5c73c6d4ab525d54d4a490a30fc6e86cf9a38b5 (patch) | |
tree | 90400252bc0751ad75d2afd4ba400e0e51d0e3e5 /apps/media/lib_media.php | |
parent | 0c0435615d58d44d5f2d33aa2760f49ce0ca2c1e (diff) | |
download | nextcloud-server-d5c73c6d4ab525d54d4a490a30fc6e86cf9a38b5.tar.gz nextcloud-server-d5c73c6d4ab525d54d4a490a30fc6e86cf9a38b5.zip |
always scan new music files
Diffstat (limited to 'apps/media/lib_media.php')
-rw-r--r-- | apps/media/lib_media.php | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/apps/media/lib_media.php b/apps/media/lib_media.php index 062672b91e8..3086f84a93a 100644 --- a/apps/media/lib_media.php +++ b/apps/media/lib_media.php @@ -24,10 +24,8 @@ //we need to have the sha256 hash of passwords for ampache OC_Hook::connect('OC_User','post_login','OC_MEDIA','loginListener'); -//connect to the filesystem for auto updating if configured -if(OC_Preferences::getValue(OC_User::getUser(),'media','autoupdate',false)){ - OC_Hook::connect('OC_Filesystem','post_write','OC_MEDIA','updateFile'); -} +//connect to the filesystem for auto updating +OC_Hook::connect('OC_Filesystem','post_write','OC_MEDIA','updateFile'); //listen for file deletions to clean the database if a song is deleted OC_Hook::connect('OC_Filesystem','delete','OC_MEDIA','deleteFile'); @@ -56,20 +54,14 @@ class OC_MEDIA{ */ public static function updateFile($params){ $path=$params['path']; - $folderNames=explode(PATH_SEPARATOR,OC_Preferences::getValue(OC_User::getUser(),'media','paths','')); - foreach($folderNames as $folder){ - if(substr($path,0,strlen($folder))==$folder){ - require_once 'lib_scanner.php'; - require_once 'lib_collection.php'; - //fix a bug where there were multiply '/' in front of the path, it should only be one - while($path[0]=='/'){ - $path=substr($path,1); - } - $path='/'.$path; - error_log($path); - OC_MEDIA_SCANNER::scanFile($path); - } + require_once 'lib_scanner.php'; + require_once 'lib_collection.php'; + //fix a bug where there were multiply '/' in front of the path, it should only be one + while($path[0]=='/'){ + $path=substr($path,1); } + $path='/'.$path; + OC_MEDIA_SCANNER::scanFile($path); } /** |