FAQ  •  Register  •  Login

How to change WebResourceItem ??

<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Tue Jan 15, 2013 1:22 am

How to change WebResourceItem ??

I have a plugin where the ExtractItem title cannot be created until I drill down a few links in ExtractUrl. If I try and do this in ExtractItem I run over the 30 second limit. I know I can change the additionalInfo with item.additionalInfo.put(var,value) but how do I change the title value in WebResourceItem(title:value, additionalInfo:[var:value]) ??

Both item.put(title,value) and item.title.put(title,videoTitle)
give me Caught: groovy.lang.MissingMethodException: No signature of method: org.serviio.library.online.WebResourceItem.put() is applicable for argument types: (null, java.lang.String) values: [null, videoTitle]
Possible solutions: wait(), dump(), any(), putAt(java.lang.String, java.lang.Object), grep(), find()
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Tue Jan 15, 2013 1:14 pm

Re: How to change WebResourceItem ??

How about

  Code:
item.title = 'bla'


or

  Code:
item.setTitle('bla')


Although I'm not 100% sure now if it'll be take into account at this stage in the process.
<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Tue Jan 15, 2013 11:35 pm

Re: How to change WebResourceItem ??

Yes, how simple! item.title = 'bla' changed the contents of item, but it appears you had already extracted the info for the menu titles. I'm surprised at the timing because at that point you cannot have finalized the menus because the extractURL method is still running and may fail.

There really are a lot of potential opportunites if the title can reflect information other than that on the initial web page. Any chance of reaccessing the still valid item titles after extractURLs is finished ?
Last edited by jhb50 on Wed Jan 16, 2013 12:01 am, edited 2 times in total.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Tue Jan 15, 2013 11:57 pm

Re: How to change WebResourceItem ??

I checked, the flow is to call extractItems() first, then iterate over all the found items, start building internal objects and as the last step of the loop is calling extractUrl(), which is then set on the internal object too.
<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Wed Jan 16, 2013 12:08 am

Re: How to change WebResourceItem ??

Thanks for checking.

There really are a lot of potential opportunites if the title can reflect information other than that on the initial web page. Any chance of updating the internal title from the item title after each extractURL is finished ?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Wed Jan 16, 2013 11:32 am

Re: How to change WebResourceItem ??

Will have a look.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Jan 17, 2013 9:25 pm

Re: How to change WebResourceItem ??

done
<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Thu Jan 17, 2013 9:32 pm

Re: How to change WebResourceItem ??

Thanks. 1.2?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Jan 17, 2013 11:25 pm

Re: How to change WebResourceItem ??

Si senor

Return to Plugin development

Who is online

Users browsing this forum: No registered users and 12 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.