Altering items ater they have been displayed
#1
All,

Is there anyway of altering a list item once it has been displayed, but without refeshing the entire contents?

I want to alter the watched status (and therefore the 'overlay' property), but without having to reload all 500 items again...
Reply
#2
Not from a plugin (at least not without hackery that you probably shouldn't be doing!)

What is it you're writing a plugin for?
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
#3
jmarshall Wrote:Not from a plugin (at least not without hackery that you probably shouldn't be doing!)

What is it you're writing a plugin for?

XBMC to Plex Media Server plugin (pleXBMC). Functionally, it's there - I'm trying to do a bit of fine tuning on it and also plug some of the workaround I put in place whilst developing.

For example, rather than using a startOffset to resume playback, I have to use player().seekTime(), which whilst it works (and is fairly robust), is probably the roundabout way (and can look a little amature). Especially when a property already exists.

I'd also like a way to toggle the watched status of a file, a la the library. I can do this, but it would require a reload of the content to change the viewed status.
Reply
#4
Technically you'll (potentially) need to refresh the listing (not necessarily retrieve the listing) on change of watched status anyway, as the user may have a filter to apply, so the items will need re-filtering etc.

If you're doing it in response to the XBMC context menu (which you have overridden in your plugin) then we could look into it I should think.

I'm not sure what your startOffset thing is - currently we don't support backends setting that, so we query the local db instead for it. I presume you have the ability to set that directly at time of listing? If so, some changes to the XBMC side would allow that to be taken into account, so that it would work out of the box. I'm not sure if the python side of it can set the startOffset param?

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
#5
Thanks for you reply.

I used to do a container.refresh, but this loaded the whole lot from scratch and took as long as the original build of the view (so around 3-4 seconds for 500 items).

as for startOffset - it's a listitem property i've tested and it works. Set it before addDirectoryItem and it allows the media to be started at a point part way through - the only problem I have it that I ask the user before playback whether to resume or start from beginning and this can only be done after the item has been added (so I can't set the property). I've tried setting it as part of the ListItem used in SetResolvedUrl, but that doesn't seem to work..

There is probably an amount of square peg into a round hole. I'm trying to emulate the full library experiance in a plugin and perhaps that's not really what a plugin is for.
Reply
#6
Regarding the resuming, as I understand it:

1. You know that the item is partially played before addDirectoryItem, so can set the startOffset.

2. You want XBMC to do it's normal thing and prompt the user at this point, but it doesn't, so you're emulating this in your plugin?

3. It doesn't work as you can't set the startoffset.

Seems like the solution is that XBMC should recognise that the item is resumeable and automatically take care of the prompting and resuming for you? This would be useful across other systems where a remote database (upnp for instance) tells us that the item is resumeable.

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
#7
This is pretty much stop on. I can set startOffset, but not after prompting the user to either resume from that offSet or start from the beginning.


What confuses me is that, we build a listitem instance and feed this into addDirectoryItem - but then before we play the item (in a seperate function), we build another listItem instance and feed that into setResolvedUrl. I don't understand how setResolvedURL knows about the 1st listItem instance?
Reply
#8
setResolvedUrl is required only if you wish to translate a plugin:// url item into the actual url at play time. It's primarily for the case where you can't supply the real URL to the item at the addDirectoryItem stage (eg further webpage scrapes or fetches, or the use of one-time URLs that would otherwise timeout etc.)

If you have the URL of the item at addDirectoryItem stage, then just set it then and forget about setResolvedURL.

As to how setResolvedURL knows about the 1st listitem instance: the user clicked on it, so XBMC holds that item. However, we pass only the URL to your plugin, so all the plugin knows about is the URL. In Dharma, we just alter the URL.

In master we also set various properties that are sent into setResolvedUrl.

Back to the task at hand: Assuming that if startOffset is set during addDirectoryItem XBMC automatically picked this up and prompted for the resume of the item from that position you'd be OK?

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
#9
jmarshall Wrote:In master we also set various properties that are sent into setResolvedUrl.

Back to the task at hand: Assuming that if startOffset is set during addDirectoryItem XBMC automatically picked this up and prompted for the resume of the item from that position you'd be OK?

Cheers,
Jonathan

Yes, this would be ok - although their may be cases where you want to resume but do not want to be prompted (not for this plugin, but perhaps in general)

As an alternative could setResolvedURL respect a startOffSet set as part of the listitem that is directly passed to it?
Reply
#10
It probably should, yes.

So we need:

1. Support for startOffset directly in listitems added via addDirectoryItem.
2. Support for startOffset in the listitem given to setResolvedUrl.

Mind opening a trac ticket with this detail so we don't forget? You can cc me.

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
#11
Hi,

Just picked up a nightly (10th Aug) and see that this has been implemented! Not sure by who (can't find the commit) - but thanks. Cuts out a load of messing, pausing and seeking from my plugin.

Spoke too soon Smile Doesn't seem to work (tested with http streams)... If someone knows where the code was altered to add this i'll have a look.
Reply
#12
Woops - I'm embarrassed...

Looks like this isn't implemented at all - seems that it's picking up some data from the sql database and presenting a resume select dialog based on some old bookmarks... I'll keep any eye on this as it may turn out to be a bug.
Reply
#13
IIRC what you needed was a way to set the startoffset (in fact, that can already be done I think via setProperty - see listitem.cpp in xbmc/interfaces/python/xbmcmodule?) in the listitem. Looks like what's not supported is the reading of that startoffset where it's needed (somewhere in GUIWindowVideoBase.cpp is my guess).
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

Logout Mark Read Team Forum Stats Members Help
Altering items ater they have been displayed0