filebot / filebot-node

Run and monitor filebot commands remotely
https://www.filebot.net/
GNU General Public License v3.0
63 stars 13 forks source link

Crash when pointing to single file #21

Closed gideonw closed 6 years ago

gideonw commented 6 years ago

I cannot run FB on the entire directory so sometimes I need to point it at a single file, well this crashes the dropdown search, but FB processes the file just fine.

GET: /folders?q=%2Fdata%2Ffile.mkv
fs.js:914
  return binding.readdir(pathModule._makeLong(path), options.encoding);
                 ^

Error: ENOTDIR: not a directory, scandir '/data/file.mkv'
    at Object.fs.readdirSync (fs.js:914:18)
    at listFolders (/usr/local/filebot-node/server/app.js:238:12)
    at handleRequest (/usr/local/filebot-node/server/app.js:303:20)
    at Server.server (/usr/local/filebot-node/server/app.js:533:16)
    at emitTwo (events.js:106:13)
    at Server.emit (events.js:194:7)
    at parserOnIncoming (_http_server.js:565:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
rednoah commented 6 years ago

Yep, that's a bug. Thanks for reporting it.

Unfortunately, I currently don't have time to work on this project and publish new releases. I'd be happy to accept a pull request though.