Beispiel #1
0
 /**
  * Invoke auto update of music database after item gets shared
  * @param array $params contains the params of the added share
  */
 public static function itemShared($params)
 {
     $app = new Music();
     $container = $app->getContainer();
     if ($params['itemType'] === 'folder') {
         $backend = new \OC_Share_Backend_Folder();
         foreach ($backend->getChildren($params['itemSource']) as $child) {
             $container->query('Scanner')->updateById((int) $child['source'], $params['shareWith']);
         }
     } else {
         if ($params['itemType'] === 'file') {
             $container->query('Scanner')->updateById((int) $params['itemSource'], $params['shareWith']);
         }
     }
 }
Beispiel #2
0
 /**
  * Invoke auto update of music database after item gets shared
  * @param array $params contains the params of the added share
  */
 public static function itemShared($params)
 {
     $container = new DIContainer();
     if ($params['itemType'] === 'folder') {
         $backend = new \OC_Share_Backend_Folder();
         foreach ($backend->getChildren($params['itemSource']) as $child) {
             $filePath = $container['API']->getPath((int) $child['source']);
             $container['Scanner']->update($filePath, $params['shareWith']);
         }
     } else {
         if ($params['itemType'] === 'file') {
             $filePath = $container['API']->getPath((int) $params['itemSource']);
             $container['Scanner']->update($filePath, $params['shareWith']);
         }
     }
 }