mirror of
https://github.com/IrosTheBeggar/mStream.git
synced 2025-10-27 07:31:02 +00:00
956 B
956 B
Get Directory Contents
Used to make a file browser. Dirparser will only return contents that are music files or other directories. Users will not be able to see any other files
-
URL
/dirparser
-
Method:
POST -
JSON Params
Required:
dir- directory to get contents fromOptional:
filetypes- limit filetypes of returned responses. Useful is your platform does not support all filetypes -
JSON Example
{ 'dir':'current/directory/', 'filetypes':['mp3', 'wav', 'flac'] } -
Success Response:
-
Code: 200
Content:{ path: 'current/directory/', contents: [{ type: 'directory', name: 'folder1'}, { type: 'mp3', name: 'file1.mp3'}] }'type' will either be 'directory' or the file extension.
-
-
Error Response:
- Code: 500 NOT FOUND
Content:{ error: 'Not a directory' }
- Code: 500 NOT FOUND