PDA

View Full Version : Plugins not sorting correctly?


stacked
2008-12-14, 10:21
I have a problem with way xbmc sorts the videos listed in plugins.

For example, if the videos were originally listed on a site as:
b, d, a, c

When the plugin lists the videos, they come out only in alphabetical order:
a, b, c, d

Sorting by the Date, file size does nothing.

Is there a way to disable xbmc's global sorting while the plugin is loaded? Or is there is method to keep the videos original order?

Voinage
2008-12-14, 16:35
You would have to add a specific plugin sort method.

What plugin is it ?

Help me help you.

stacked
2008-12-14, 23:42
I finally found a solution...

x=0
for name, thumb, url in site:
name = str(int(x+1))+'. '+name
li=xbmcgui.ListItem(name, iconImage=thumb, thumbnailImage=thumb)
li.setInfo( type="Video", infoLabels={ "Title": name } )
u=sys.argv[0]+"?mode=1&name="+urllib.quote_plus(name)+"&url="+urllib.quote_plus(url)
xbmcplugin.addDirectoryItem(int(sys.argv[1]),u,li)
x=x+1



This will list all my vidoes as:
1. Title
2. Another Title
3. Another Another Title

So now xbmc won't have a problem sorting "By Name".