• 1
  • 18
  • 19
  • 20
  • 21
  • 22(current)
HEADS UP: Filling a list from a directory/plugin
(2016-01-02, 09:38)butchabay Wrote: You could try big noid's library data provider script. It's super fast and auto refresh.
Solved my problem with resumable movies.

Thanks a lot for the tip.

Actually, I was trying to reduce the amount of add-ons needed by the skin.

Currently I'm using service.skin.widgets for random items, although using library data provider certainly would reduce the skin code, and possibly also increase performance.

Like many others, I have tried Container.Update and Container.Refresh, but didn't see any effect.
Reply
Addition: Actually, this works when doing it right! D'OH! Smile
Reply
Hi

I have a widget with content is a directory on my NAS.
somethhing like
<content>smb://NAS/Dir/</content>

In this directory i have only sub-directory

The widget displays what i want (ie the sub-directory), but when i click on it, nothing happens
I expected it opens a window, like a myvideonav in file view

I tried to change the "target" parameters ..

maybe I have to perform some tricks with override onclick action ?
http://kodi.wiki/view/Dynamic_List_Conte...ick_action
Reply
(2015-03-08, 15:57)sualfred Wrote:
(2015-03-08, 13:27)Jeroen Wrote: Haven't tested, but you could experiment with these as additional onclick actions

Container.Refresh Refresh current listing.
Container.Update Update current listing. Send Container.Update(path,replace) to reset the path history.

Also fighting it.
These commands do their job on a library view very well but not on my dynamic lists widgets.

The only dirty and ugly workaround I found is to place conditions like that in the home.xml header:
<onload condition="Window.Previous(Visualisation)">XBMC.ReloadSkin()</onload>
<onload condition="Window.Previous(FullscreenVideo)">XBMC.ReloadSkin()</onload>

Edit:

Read the complete thread again, this is working:
(2014-05-03, 16:44)`Black Wrote: This should work:

PHP Code:
#Home window
<onload>SetProperty(RefreshList,1,Home)</onload>

#Content
<content>$VAR[PlaylistPath]</content>

#Path Variable
<variable name="PlaylistPath">
    <
value condition="!Window.IsVisible(3050)">path_to_playlist</value>
</
variable>

#Custom window
<?xml version="1.0" encoding="UTF-8"?>
<window type="dialog" id="3050">
    <allowoverlay>no</allowoverlay>
    <onload>ClearProperty(RefreshList,Home)</onload>
    <visible>!IsEmpty(Window(Home).Property(RefreshList))</visible>
    <animation effect="fade" start="100" end="0" time="0" delay="5">WindowClose</animation>
    <controls></controls>
</window> 

That way the path gets changed on window load which triggers a refresh. Clearing the property just after setting it in onload doesn't work because it happens in the same frame so the application will not notice the change. Since AlarmClock doesn't work with ms, you need the custom window unless you can live with a 1 second delay.

I plan to add a reload function for the container which will make it much easier to manually trigger an update.

"I plan to add a reload function for the container which will make it much easier to manually trigger an update."

Has this "reload function" to manually trigger a refresh of the list ever come to see the light? I have a dynamic list using the content tag below.

Code:
<content>plugin://plugin.audio.pandoki/</content>

which on window load gives me a list that comes from the code below.

Code:
def Dir(self, handle):
        self.Login()
        ic = Val('icon')
        li = xbmcgui.ListItem('New Station ...')
        li.setIconImage(ic)
        li.setThumbnailImage(ic)
        xbmcplugin.addDirectoryItem(int(handle), "%s?search=hcraes" % _base, li)
        for s in self.Sorted():
            li = xbmcgui.ListItem(s['title'], s['token'])
            if self.station == s: li.select(True)
            art = Val("art-%s" % s['token'])
            if not art: art = s.get('art', ic)
            li.setProperty( "stationId", s['id'] )
            li.setIconImage(art)
            li.setThumbnailImage(art)
            title = asciidamnit.asciiDammit(s['title'])
            rurl = "RunPlugin(plugin://%s/?%s)" % (_id, urllib.urlencode({ 'rename' : s['token'], 'title' : title }))
            durl = "RunPlugin(plugin://%s/?%s)" % (_id, urllib.urlencode({ 'delete' : s['token'], 'title' : title }))
            surl = "RunPlugin(plugin://%s/?%s)" % (_id, urllib.urlencode({  'thumb' : s['token'], 'title' : title }))
            li.addContextMenuItems([('Rename Station', rurl),
                                    ('Delete Station', durl),
                                    ('Select Thumb',   surl), ])
            burl = "%s?%s" % (_base, urllib.urlencode({ 'play' : s['token'] }))
            xbmcplugin.addDirectoryItem(int(handle), burl, li)
        xbmcplugin.endOfDirectory(int(handle), cacheToDisc = False)
        Log("Dir   OK %4s" % handle)

It gives me a list of Pandora radio stations. If I use the context menu to delete a station, it runs the code to delete the station below.

Code:
def Delete(self, token):
        if (self.station) and (self.station['token'] == token): self.station = None

        self.Stations()
        station = self.pithos.delete_station(token)

        Log('Delete  ', station, xbmc.LOGNOTICE)
        xbmc.executebuiltin("Container.Refresh")

However, after deleting the station, the list doesn't refresh and show without the deleted station unless I close and open the window to trigger a reload of the content.

I would think that the "xbmc.executebuiltin("Container.Refresh")" on the last line would refresh the list after deleting but it doesn't. I have tried adding a button on the window with an onclick coded from python...
Code:
def onClick(self, controlID):

    if controlID == 559:
        xbmc.executebuiltin("Container.Update(plugin://plugin://plugin.audio.pandoki/)")

#also tried...

    xbmc.executebuiltin("Container.Update(plugin://plugin://plugin.audio.pandoki/),replace")

    xbmc.executebuiltin("Container.Refresh(plugin://plugin://plugin.audio.pandoki/)")

But nothing I try works. Anybody know how I can accomplish how to trigger a list refresh after deleting a station? Thanks.
Reply
What you can do is build the url with a window property. Then change the window property after deleting/adding an item and the list should reload.
Reply
(2017-01-19, 16:54)BigNoid Wrote: What you can do is build the url with a window property. Then change the window property after deleting/adding an item and the list should reload.

Can you elaborate please. Not sure exactly what you mean. Do you mean to set a window property like say...


Code:
$INFO[Window(Home).Property(plugin://plugin.audio.pandoki/)]

What would I use for the content tag?

Code:
<content>plugin://plugin.audio.pandoki/?mylist=$INFO[Window(Home).Property(plugin://plugin.audio.pandoki/)]</content>

Would I just clear the window property and then set it again to refresh the list? Thanks.
Reply
(2017-01-19, 17:14)woodside Wrote:
(2017-01-19, 16:54)BigNoid Wrote: What you can do is build the url with a window property. Then change the window property after deleting/adding an item and the list should reload.

Can you elaborate please. Not sure exactly what you mean. Do you mean to set a window property like say...


Code:
$INFO[Window(Home).Property(plugin://plugin.audio.pandoki/)]

What would I use for the content tag?

Code:
<content>plugin://plugin.audio.pandoki/?mylist=$INFO[Window(Home).Property(plugin://plugin.audio.pandoki/)]</content>

Would I just clear the window property and then set it again to refresh the list? Thanks.

Or.. WIN.setProperty("mylist","plugin://plugin.audio.pandoki/")
and then use
Code:
<content>plugin://plugin.audio.pandoki/?mylist=$INFO[Window(Home).Property(mylist)]</content>

and then clear and reset the window property to refresh?
Reply
I would use a date time stamp as property and just update that with new time when the items are deleted/added.
In the content tag load it like this: <content>plugin://plugin.audio.pandoki/?reload=$INFO[Window(Home).Property(Pandoki.Reload)]</content>
Reply
(2017-01-19, 17:33)BigNoid Wrote: I would use a date time stamp as property and just update that with new time when the items are deleted/added.
In the content tag load it like this: <content>plugin://plugin.audio.pandoki/?reload=$INFO[Window(Home).Property(Pandoki.Reload)]</content>

Ahhh... Works great! Thanks. Big Grin
Reply
(2017-01-10, 18:51)gates Wrote: Hi

I have a widget with content is a directory on my NAS.
somethhing like
<content>smb://NAS/Dir/</content>

In this directory i have only sub-directory

The widget displays what i want (ie the sub-directory), but when i click on it, nothing happens
I expected it opens a window, like a myvideonav in file view

I tried to change the "target" parameters ..

maybe I have to perform some tricks with override onclick action ?
http://kodi.wiki/view/Dynamic_List_Conte...ick_action

Any Idea ?
Reply
(2017-01-29, 10:21)gates Wrote:
(2017-01-10, 18:51)gates Wrote: Hi

I have a widget with content is a directory on my NAS.
somethhing like
<content>smb://NAS/Dir/</content>

In this directory i have only sub-directory

The widget displays what i want (ie the sub-directory), but when i click on it, nothing happens
I expected it opens a window, like a myvideonav in file view

I tried to change the "target" parameters ..

maybe I have to perform some tricks with override onclick action ?
http://kodi.wiki/view/Dynamic_List_Conte...ick_action

Any Idea ?

Please post the exact code you are using in the content tag.
Reply
Hi BigNoid,

I use this in an include :

so my content is :
<content target="$PARAM[pTarget]" sortby="$PARAM[pSortBy]" sortorder="$PARAM[pSortOrder]" limit="$PARAM[pLimit]">$PARAM[pContent]</content>

and my params are :
<param name="pContent">smb://SYNOLOGY/video/Kids/</param>
<param name="pSortBy">random</param>

<param name="pTarget" default=""/>
<param name="pSortOrder" default=""/>
<param name="pLimit" default="10"/>


I tried with pTarget= File / file and more
like i said, everything is diplayed well
but nothing happens when i click on and item

for information smb://SYNOLOGY/video/Kids/ only contains directory
so all the item in this widget are (sub)directory

best regards
Reply
You need to specify which window needs to open in the target. So for the kids videos to open in the Videos media window you must use
Code:
target="videos"
Reply
I'm pretty sure I've already used target="videos" before

but indeed, that the good (and obvious Smile ) parameter

thank you BigNoid !

I think i have lost my focus/mind after doing to many modifcation at the same time
Reply
  • 1
  • 18
  • 19
  • 20
  • 21
  • 22(current)

Logout Mark Read Team Forum Stats Members Help
HEADS UP: Filling a list from a directory/plugin1