From 59d4316ec9a0f2ede61a6620e37da63de4c4ee61 Mon Sep 17 00:00:00 2001 From: alphayax Date: Tue, 14 Jun 2016 22:38:16 +0200 Subject: [PATCH] Fix FileSystem Listing during tests --- exemple/FileSystem/fsListing.php | 8 +++----- .../api/v3/services/FileSystem/FileSystemListing.php | 11 ++++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/exemple/FileSystem/fsListing.php b/exemple/FileSystem/fsListing.php index 8356d97..42c9bee 100644 --- a/exemple/FileSystem/fsListing.php +++ b/exemple/FileSystem/fsListing.php @@ -11,14 +11,12 @@ $App->openSession(); /// Scan files in root $FSListService = new \alphayax\freebox\api\v3\services\FileSystem\FileSystemListing( $App); $FilesInRoot = $FSListService->getFilesFromDirectory( '/'); -foreach( $FilesInRoot as $fileInfo){ - echo '- '. $fileInfo->getPath() . PHP_EOL; -} +print_r( $FilesInRoot); /// Get a file information (Will throw an exception if file does not exists) try { - $VideoFile = $FSListService->getFileInformation( '/Disque dur/Téléchargements/The.100.S03E14.FASTSUB.VOSTFR.1080p.HDTV.x264.AAC-GOBO2S/The.100.S03E14.FASTSUB.VOSTFR.1080p.HDTV.x264.AAC-GOBO2S.mkv'); - var_dump( $VideoFile); + $VideoFile = $FSListService->getFileInformation( '/Disque dur/Téléchargements/'); + print_r( $VideoFile); } catch (Exception $e){ echo $e->getMessage(); } diff --git a/freebox/api/v3/services/FileSystem/FileSystemListing.php b/freebox/api/v3/services/FileSystem/FileSystemListing.php index d1eb23d..633701a 100644 --- a/freebox/api/v3/services/FileSystem/FileSystemListing.php +++ b/freebox/api/v3/services/FileSystem/FileSystemListing.php @@ -24,11 +24,12 @@ class FileSystemListing extends Service { public function getFilesFromDirectory( $DirectoryName = '/Disque dur/', $onlyFolder = true, $countSubFolder = false, $removeHidden = true){ $Directory_b64 = base64_encode( $DirectoryName); $rest = $this->getAuthService( self::API_FS_LS . $Directory_b64); - $rest->GET([ - 'onlyFolder' => $onlyFolder, - 'countSubFolder' => $countSubFolder, - 'removeHidden' => $removeHidden, - ]); + $rest->GET(); + // $rest->GET([ + // 'onlyFolder' => $onlyFolder, + // 'countSubFolder' => $countSubFolder, + // 'removeHidden' => $removeHidden, + // ]); return $rest->getResultAsArray( models\FileSystem\FileInfo::class); }