• 1
  • 5
  • 6
  • 7(current)
  • 8
  • 9
Virtual Python Folders
#91
Thanks, I changed that additem already, i edited my above post.

About the rating, I was thinking ListItem.Rating was MPAARating

Edit: I reread your post JM, I'll set them in listitem.cpp, I had changed it so you didn't have to pass it to addItem(), but not setDirectoryItem().
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#92
Regarding label2 (and label1 for that matter):

XBMC sets these based on the label format which is a property of the GUIViewState class. These are setup in GUIViewStateVideo.cpp for instance, and can be varied based on the URL.

The idea is we allow this to be overridden for plugin:// folders. It would re-call the script (highly inefficient, but I'm not sure how else to do it at this point - perhaps adding them as members of the CFileItemList may be the way to do it, eg via a CGUIViewState * member.) and ask for the label formats, sort methods, sort orders and view types.

XBMC then takes care of the rest, setting the view mode and so on.

Context menu stuff is done in a similar fashion, though re-calling the script here is not that inefficient, given it's a one-off action prior to calling the context menu, and a repeat call to execute the action (if necessary).

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#93
http://xbmc-scripting.googlecode.com/svn...Plugin.zip

Ok, I commented out the preformatted line. I committed what I have. The listitems setInfo() now accepts type(string), tags(dictionary { 'Genre': 'Comedy' }).

It's much better using a dictionary, thanks for your help JM.

There is one problem, There is a unicode problem with certain plots from Apple Movie Trailers. They should be UTF-8, but when I try to send plot it errors. Huh

Also, I did not move url or isFolder from setDirectoryEntry() yet. How would you pass it to setInfo()? I think they need their own argument as opposed to part of tags. I think of the tags as the infolabels.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#94
You don't have to send url or isFolder separately - it doesn't really matter where it is as far as that goes - it's either in this function or it's going to be in another one after all.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#95
"setInfo(type, url, tags[, isFolder]) -- Sets the listitem's media tags.\n"

I moved them, but kept them separate. I thought they were kind of important and I still consider the tags argument infolabels only. It can be changed if you want though.

Edit: Now that I see it in action. I think either the tags needs to be optional and/or url and isfolder could be put in it. especially url. They really only have meaning for plugins.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#96
Agreed - feel free to switch it back to how it was Smile
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#97
Quote:
changed: moved url and isFolder arguments back to XBMC_setDirectoryEntry
changed: ListItem_SetInfo "tags" keyword -> "infoLabels". (Maybe a better name for that is required, also "type" is a python keyword, maybe a better name for that)
added: a few more infolabels to "video", "music", "pictures" (Needs work especially "pictures"

JMarshall, the "pictures" infoLabels needs your touch. The members are protected and I didn't see a set() function. Probably right in front of me.

Please check ( and add Smile ) any ones I missed.

thanks

Now we nned to add your fix, so the plugin can control label2.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#98
Cool - have added "back end" support for settings sort method and label format to the CFileItemList, and some example code in CPluginDirectory::EndDirectory() to set a bunch of them.

I suggest a new method to add a single sort method + label layout (that just does a single AddSortMethod() call).

We may need to add label format identifiers for some of the other infolabels.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#99
I'll work on this method later this afternoon, if no one else volunteers.

Also, I would like to merge the main trunk into plugins. If I'm successful, do you mind if I commit?
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
I just merged the main trunk into my local sources. If it compiles ok, I'll commit it, it will be about an hour. I'll check back here first.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
committed the merge.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
No problems on the merge - I can confirm that it builds fine.

I think we need a TODO list of what else needs doing before we mainline this:

1. Ability to have cancellability (and updating a progress bar) of folder browsing.

2. Get Sort methods/label formatting done (default sort method needed?)

Possibly:

3. Contextual menus - both a system to request a list of context menu items (for when WHITE is performed within a plugin dir), and a system to execute the action.

Proposed implementation:

1. PluginDirectory has a loop running and pops up the progress bar after (say) 1.5 seconds. AddItem() automatically updates the progress bar contents, and we should have the possibility in there to set the percentage done (if the script knows it). On cancel, we request that python kills the script. I'll have a play with the progress bar stuff and see how it works out.

2. As detailed in a previous post - just a method to add a single sort method, and (if necessary) a method to set the default sort method. The default can just be the first sort method I suspect? We also need to add any additional format label strings as necessary. Nuka1195's working on this Smile

3. I suspect we call the script in both cases with a special parameter (maybe <scriptname>?action=ContextMenu(<path>) and <scriptname>?action=ContextAction(<action>,<path>) perhaps?). Some sort of generic action system so it can be extended later if necessary. ContextMenu(<path>) will effectively return a directory list of items that XBMC will transform into a context menu, whereas ContextAction() will perform an action.

Anything else needed?

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
Quote:1. PluginDirectory has a loop running and pops up the progress bar after (say) 1.5 seconds. AddItem() automatically updates the progress bar contents, and we should have the possibility in there to set the percentage done (if the script knows it). On cancel, we request that python kills the script. I'll have a play with the progress bar stuff and see how it works out.
Agreed, just need to return a flag set to True, so the script can gracefully exit.

Quote:2. As detailed in a previous post - just a method to add a single sort method, and (if necessary) a method to set the default sort method. The default can just be the first sort method I suspect? We also need to add any additional format label strings as necessary. Nuka1195's working on this Smile
I am working on this. From a scripters perspective can't we determine the mask in the method, based on the sort method, so the scripter would only have to pass (handle, sortMethod, buttonLabel)?

Quote:3. I suspect we call the script in both cases with a special parameter (maybe <scriptname>?action=ContextMenu(<path>) and <scriptname>?action=ContextAction(<action>,<path>) perhaps?). Some sort of generic action system so it can be extended later if necessary. ContextMenu(<path>) will effectively return a directory list of items that XBMC will transform into a context menu, whereas ContextAction() will perform an action.
Sounds good, this along with buttons are only needed if you want to extend plugins to near equality with scripts. Which is good in my opinion.

I hope my merge didn't scare you Smile It went smoothly with no conflicts or I would have left it to you. Tongue
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
We should also check if the script died already. I have no XDK and sources here, but there should be some method to figure that out as the scripts browser shows the running state of scripts. Is there also a method to determine the exit code of a script, so we can display an error message that the script died unexpectedly? Maybe then we could also remove the endOfDirectoy... function.
Reply
BTW: Why doesn't the IMDB scraper work for the plugins? I tried it with Joox and TVLinks and it doesn't seem to do anything useful.
Reply
  • 1
  • 5
  • 6
  • 7(current)
  • 8
  • 9

Logout Mark Read Team Forum Stats Members Help
Virtual Python Folders0