Get virtual library path instead of file path?
#1
I'm working on something where I first make a request to Files.GetDirectory, like: {"jsonrpc":"2.0","id":5,"method":"Files.GetDirectory","params":{"directory":"videodb://tvshows/titles"}}
Which gets me back something that looks like this:

json:

{
  "id": 5,
  "jsonrpc": "2.0",
  "result": {
    "files": [
      {
        "file": "F:\\tvshows\\Rick and Morty (2013)\\",
        "filetype": "directory",
        "id": 1,
        "label": "Rick and Morty",
        "type": "tvshow"
      },
      ...
    ],
    "limits": {
      "end": 5,
      "start": 0,
      "total": 5
    }
  }
}

However, when browsing my library (for example, at the TV Shows -> Titles section), if I read the InfoLabels for any of these shows, I actually get something quite different for the folder path, like for "Rick and Morty" shown above:
json:

ListItem.FolderName: Rick and Morty (2013)
ListItem.FolderPath: videodb://tvshows/titles/1/?xsp=%7b%22order%22%3a%7b%22direction%22%3a%22ascending%22%2c%22ignorefolders%22%3a0%2c%22method%22%3a%22sorttitle%22%7d%2c%22type%22%3a%22tvshows%22%7d
ListItem.Path: F:\tvshows\Rick and Morty (2013)\

My add-on is only able to get these responses from the JSON-RPC... but is there no way to get that "virtual path" that is stored in ListItem.FolderPath for library items?

The closest I've been able to get is to "construct" it manually, using the id from the JSON response, but not only does that method start to get quite complicated when dealing with seasons, episodes, or other media (like music libraries), it also isn't very straightforward to respect the other settings which are passed through via the xsp URL parameter.

EDIT: For the purposes of this post, all my requests and InfoLabel parsing were done using @rmrector's wonderful Devhelper Web interface Big Grin
Reply

Logout Mark Read Team Forum Stats Members Help
Get virtual library path instead of file path?0