$valid_ext = array("mp3", "wav", "m3u");
$list = ftp_mlsd($this->connectionId, $directory);
if(!empty($list)){
foreach ($list as $file) {
switch ($file['type']) {
case 'file': if(in_array(rotator_getExtension($file['name']),$valid_ext) && $this->rotator_preload2scan($directory.'/'.$file['name']) ) {
$this->fileList[]['tags'] = rotator_get_tags(TMP);
$this->fileList[]['FilePath'] = explode(MEDIALIB, $directory.'/'.$file['name'])[1];
} break;
case 'dir': $this->listFile2($directory.'/'.$file['name']); break;
}
}
}
return $this->fileList;