Open ActivateWindow in a SubDirectory
#1
I would like a JSON call that would navigate the UI of my XBMC(gotham) in a specific video location.. It's not Movies or Tv-Shows, it's a Video Source folder.. I map that to all the stuff I downloaded but didn't had time to triage and import in the movie library yet..

To Access it I go in Video, Files, then I have a list of my different library, mine is called "Download".. I am trying to use ActivateWindows to open the VideoFile Windows in that specific directory..

I Have tried the following:

ActivateWindow(Videos,videodb://)
ActivateWindow(Videos,sources://video/)

They both look like doing the exact same thing.. Open the Video Library windows in whatever folder was open last..

I Also tried:

ActivateWindow(Videos,videodb://Files/Download)
ActivateWindow(Videos,videodb://Download)
ActivateWindow(Videos,sources://video/Files/Download)
ActivateWindow(Videos,sources://video/Download)

With no good result.. I didn't found any way to specify what directory to point it in..

Did someone tried this or have an idea how I could get this to work?..

I guess I could do a kind of macro that simply go to home screen, and then send remote navigation command left,right,bottom,enter until I reach my directory but I'm not really a fan of that option, too much chance of error..

Thanks
Reply
#2
GUI.ActivateWindow + parameters doesnt work? (you can find the correct vfs path by browsing to your preferred location and showing Container.FolderPath in a skin label control)
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#3
Thanks for your reply, I am unfamiliar with skin editing but I will give it a try to see if I can get a proper FolderPath parameters to give to ActivateWindows Smile
Reply
#4
So, as a follow up on this, got it to work, thanks phil65 for the guidance..

The proper call was: ActivateWindow(Videos,smb://SERVER/path/to/my/DownloadFolder)

This is funny Because in all JSON documentation they talk about videodb:// and source:// but they don't really talk about putting your own path or smb:// path.. and I was thinking of the path of where my download folder was mounted.. not the source path of the mount..


Displaying the proper FolderPath toke some time to figure out..

First I needed to do an editable copy of Confluence, as per this thread:
http://openelec.tv/forum/128-addons/5187...-in-a-skin
then I modified MyVideoNav.xml to modify a label to display Container.FolderPath instead of Container.FolderName

I could retreive the Path of all my directory, and the path of Video Plugins, etc.. Great help to do JSON ActivateWindows calls Smile
Reply
#5
Hi, I think this is related to this thread. I've been at this a couple of hours now and can't seem to get it right. I'm trying to open a path from a favorite that reads:

<favourite name="Name-of-Directory">ActivateWindow(10025,&quot;smb://userid:password@servername/path-to-directory/&quot;,return)</favourite>

I think the json-rpc call below is the right call. It certainly works if I put in the "videodb://movies/titles/", but if fails if the smb path is the parameter.

{"jsonrpc":"2.0","method":"GUI.ActivateWindow","id":1,"params":{"window":"videos","parameters": ["smb://userid:password@servername/path-to-directory/"]}}

The error I get is in an error dialog on the device that says: "Error 2: share not available" OK. And the json-rpc response is result:"OK"

also tried
{"jsonrpc":"2.0","method":"GUI.ActivateWindow","id":1,"params":{"window":"video","parameters": ["smb://userid:password@servername/path-to-directory/"]}}
{"jsonrpc":"2.0","method":"GUI.ActivateWindow","id":1,"params":{"window":"videofiles","parameters": ["smb://userid:password@servername/path-to-directory/"]}}
{"jsonrpc":"2.0","method":"GUI.ActivateWindow","id":1,"params":{"window":"videolibrary","parameters": ["smb://userid:password@servername/path-to-directory/"]}}

I have tried dozens (perhaps hundreds) of variations and at this point just need another pair of eyes on it.

BTW, the favorite works when I hit it with Kodi. (I'm using json-rpc\v6)

Thanks
Reply
#6
Hmmm, I have a followup.

On a hunch I tried just a made up path and got the same error, so that started me thinking that it might not like something in the path. But there were no funny characters.

But there were some spaces and the last directory name has a comma in it. This is a long path, with 5 directories. The first 3 have no spaces in their names, so I trimmed it down and sure enough it works.

After some investigation, it appears the problem character is the comma. I tried a sibling directory that is longer but does not have a comma in the name and that worked.

I tried to urlencode it and that doesn't work. At this point, I'm inclined to think that somewhere the code is splitting a list (perhaps the parameters array) by looking for commas and that's busting up the path prematurely.

What do you think? Scott
Reply
#7
hurlbert, spot on. "something" does just that. if you quote the parameter however, it won't. "foo,bar"
Reply
#8
Ah, very good. When I tested this at 4am I tried "" and not \" to add quotes to my parameter in quotes. This does indeed work.

{"jsonrpc":"2.0","method":"GUI.ActivateWindow","id":1,"params":{"window":"videos","parameters": ["\"smb://userid:password@servername/path-to-directory-with-comma-in-name/\""]}}

Thanks for the help. I now have a full on "favourites" panel on a HomeCenter (web) site and it's working great - all over json-rpc. My girlfriend can now click "Christmas Music in PartyMode" or "Random Unwatched Episode" of her favourite TV show, her favourite podcast (without drilling down and down to get it), or select one of the Favourites from her phone or iPad mini connected to our in house wifi and things just start coming alive!

Scott
Reply
#9
Thanks for the help @ironic_monkey.

I had a real struggle getting this to work, mostly because when it comes to Favourites there is little documentation (that I could find). (for example to find the field names I ended up reading through the C++ source code).

So if I wanted to do a short write-up on what I did in the effort to possibly help others, where do you think would be the best place to post it? (sorry but I'm old to xbmc but new to the forum)

Thanks
Reply
#10
write it, post it in general and if deemed good enough a mod will move to the tricks, help, et al forum (which is read-only, you cannot open there on your own). thanks.
Reply
#11
Done. Thanks http://forum.kodi.tv/showthread.php?tid=...pid1853574
Reply
#12
Hi!
sorry for hijacking this one, but the information I found are wery thin in the interwebz - maybe you are the exact right ones to ask.

I really don't want to start coding again, I am just wondering how
Code:
ActivateWindow(Videos,smb://SERVER/path/to/my/DownloadFolder)
would work, when my
Code:
ActivateWindow(Videos,nfs://SERVER/path/to/my/DownloadFolder,return)
won't.
Should this really depend on the protocol?

Background: I created a custom tile in a skin for a favourite path (tv shows via nfs, for some shows won't be added in my library due to missing information to fetch online, like "the boondocks")
I set this favourite as a target for my tile (using eminescence skin), but I always end up in my video library.

I then used that tile to set the path manually like said above. - No change

I browsed through my "files" path manually, that worked. So no connection issues.

any ideas appreciated.
(will try the function on another skin though)

Thanks, and again, apologies for the hijack
Reply
#13
(2015-07-11, 12:53)erdnuesse Wrote: Hi!
sorry for hijacking this one, but the information I found are wery thin in the interwebz - maybe you are the exact right ones to ask.

I really don't want to start coding again, I am just wondering how
Code:
ActivateWindow(Videos,smb://SERVER/path/to/my/DownloadFolder)
would work, when my
Code:
ActivateWindow(Videos,nfs://SERVER/path/to/my/DownloadFolder,return)
won't.
Should this really depend on the protocol?

Background: I created a custom tile in a skin for a favourite path (tv shows via nfs, for some shows won't be added in my library due to missing information to fetch online, like "the boondocks")
I set this favourite as a target for my tile (using eminescence skin), but I always end up in my video library.

I then used that tile to set the path manually like said above. - No change

I browsed through my "files" path manually, that worked. So no connection issues.

any ideas appreciated.
(will try the function on another skin though)

Thanks, and again, apologies for the hijack

Looks to me like it should work. Try putting the path in quotes. Also, you might double check security on the NFC share.
Reply
#14
(2015-07-13, 22:35)hurlbert Wrote:
(2015-07-11, 12:53)erdnuesse Wrote: Hi!
sorry for hijacking this one, but the information I found are wery thin in the interwebz - maybe you are the exact right ones to ask.

I really don't want to start coding again, I am just wondering how
Code:
ActivateWindow(Videos,smb://SERVER/path/to/my/DownloadFolder)
would work, when my
Code:
ActivateWindow(Videos,nfs://SERVER/path/to/my/DownloadFolder,return)
won't.
Should this really depend on the protocol?

Background: I created a custom tile in a skin for a favourite path (tv shows via nfs, for some shows won't be added in my library due to missing information to fetch online, like "the boondocks")
I set this favourite as a target for my tile (using eminescence skin), but I always end up in my video library.

I then used that tile to set the path manually like said above. - No change

I browsed through my "files" path manually, that worked. So no connection issues.

any ideas appreciated.
(will try the function on another skin though)

Thanks, and again, apologies for the hijack

Looks to me like it should work. Try putting the path in quotes. Also, you might double check security on the NFC share.
Yup, and make sure that kodi knows about the login credentials.
Also perhaps worth tryin out to append a "/" (not likely that this is the cause, but worth a try, I´m just guessin here)
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply

Logout Mark Read Team Forum Stats Members Help
Open ActivateWindow in a SubDirectory0