"visible" for Youtube Submenu Items (only if Login exists)
#1
Hello

Did try to set the visible for Submenuitems "youtube"

The Problem there: some of them should only apear if the User is Logged in.

Did try to check if the path is Empty (which would be the case for things like youtube vavorites and Playlists, if the user isn't logged in i guess)

PHP Code:
<onclick>ActivateWindow(10025,&quot;plugin://plugin.video.youtube/?login=true&amp;path=%2froot%2fliked&amp;scraper=liked_videos&quot;,return)</onclick>
<visible>!IsEmpty(plugin://plugin.video.youtube/?login=true&amp;path=%2froot%2fliked&amp;scraper=liked_video)</visible> 

did also try "!IsEmpty(ListItem.Path)" which didnt work also. (Submenuitem is a Button)

so i thouth i might ask if someone got a Idea or solution.

thanks.
Reply
#2
not possible afaik.
IsEmpty() only works for info labels, not for paths.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#3
Thanks for your reply.

so it seems this one gonna be a tough one. at the Moment i have no Idea how else i could do it.



Edit:

o.k. seems i finde a Workaround. Sadly i cant test if the visible condition work if im not logged in. (cant logout from Addon)

here is how i did (try) it:

PHP Code:
<control type="button" id="12345">
       <
label>test</label>
       <
texturefocus>plugin://plugin.video.youtube\thumbnails\liked.png</texturefocus>
       
<onclick>ActivateWindow(10025,&quot;plugin://plugin.video.youtube/?login=true&amp;path=%2froot%2fliked&amp;scraper=liked_videos&quot;,return)</onclick>
       
<visible>!IsEmpty(Control.GetLabel(12345))</visible>
</
control


Edit2:

O.K. did rethink about the solution.
think this shows the item always couse the "liked.png" is available no mather if the user is logged in or not (imho.). uu
Reply
#4
Could you not substring the paths to see if the user is logged into youtube?

Code:
<visible>substring(Container.FolderPath,video.youtube) + [substring(Container.FolderPath,login=true) | substring(ListItem.FileNameandPath,login=true)]</visible>
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#5
(2014-10-06, 22:22)MassIV Wrote: Could you not substring the paths to see if the user is logged into youtube?

Code:
<visible>substring(Container.FolderPath,video.youtube) + [substring(Container.FolderPath,login=true) | substring(ListItem.FileNameandPath,login=true)]</visible>

that only works when you are "inside" the addon, not from outside.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#6
It's probably a workaround too far, but could you do something like the following in MyVideoNav.xml

Code:
<onload condition="substring(Container.FolderPath,video.youtube) + [substring(Container.FolderPath,login=true) | substring(ListItem.FileNameandPath,login=true)]">Skin.SetBool(YoutubeLoggedIn)</onload>

and then check for Skin.HasSetting(YoutubeLoggedIn) as your visibility condition for the menu entry? (With the substrings shamelessly copied from MassIV's earlier post)
Reply
#7
won´t work too I guess. since it is a "normal" plugin it won´t do anything unless you enter it. what would be neccessary is to "extend" the plugin to be a script / service at the same time so that you can either use RunScript(...) to get that info or it sets the info as a window property itself.
(would be great if i am wrong so please correct me in that case Wink )
i would have an idea for a very dirty workaround, but i would never recommend that to someone. Big Grin
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#8
Ah, true. It would require a direct link to the plugin for the skin setting to get set. Dirty workarounds may indeed be the only way.
Reply
#9
Thanks for all The Feedback!!

So it seems i have to give up on that.

(Did also play around with Substring (and Stringcompare). with no luck as you might guess.)

Thanks for the feedback!
Reply

Logout Mark Read Team Forum Stats Members Help
"visible" for Youtube Submenu Items (only if Login exists)0