Files.GetDirectory returns "filetype":"file" where should be a "filetype":"directory"
#1
Hi to all,

I execute a Files.GetDirectory of a video directory, which contains six subdirectories and no files (video files are instead in those subdirectories). In the returned result, I see five elements of "filetype":"directory" as expected, and one element of "filetype":"file", which is not expected!

That wrong element is actually a video file contained into the sixth directory; I suppose the first one in alphabetical order of the many ones contained in the same one.
  • The sixth directory contains many video files, they are different, unrelated movies (not episodes, not pieces of videos to be stacked);
  • The whole video directory tree was added to the library using metadata from some .nfo files, but only the sixth subdirectory contains videos with .nfo metadata. For absurd the only folder with tagged files, is the only one that is badly managed.
Is that an expected behaviour or is it a bug? If it is expected, can someone please explain the rationale?

The problem is that a remote app (Yatse for Android) will display that directory as a single file, and I cannot browse into it! I'm testing the API with curl on localhost, Kodi is version 17.6, running on a Debian GNU/Linux box.
Reply
#2
There is a difference if I make the following two RPC calls:
Quote:{"id":100,"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"/data/videos/"}}
this one will return the expected answer: all the items are returned as filetype directory
Quote:{"id":100,"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"/data/videos/","media":"video"}}
this one instead will return the first video inside (i.e. it descends one level down, instead of returning the directory itself), marked as filetype file.
Reply

Logout Mark Read Team Forum Stats Members Help
Files.GetDirectory returns "filetype":"file" where should be a "filetype":"directory"0