Page 1 of 1

How to change WebResourceItem ??

PostPosted: Tue Jan 15, 2013 1:22 am
by jhb50
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()

Re: How to change WebResourceItem ??

PostPosted: Tue Jan 15, 2013 1:14 pm
by zip
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.

Re: How to change WebResourceItem ??

PostPosted: Tue Jan 15, 2013 11:35 pm
by jhb50
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 ?

Re: How to change WebResourceItem ??

PostPosted: Tue Jan 15, 2013 11:57 pm
by zip
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.

Re: How to change WebResourceItem ??

PostPosted: Wed Jan 16, 2013 12:08 am
by jhb50
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 ?

Re: How to change WebResourceItem ??

PostPosted: Wed Jan 16, 2013 11:32 am
by zip
Will have a look.

Re: How to change WebResourceItem ??

PostPosted: Thu Jan 17, 2013 9:25 pm
by zip
done

Re: How to change WebResourceItem ??

PostPosted: Thu Jan 17, 2013 9:32 pm
by jhb50
Thanks. 1.2?

Re: How to change WebResourceItem ??

PostPosted: Thu Jan 17, 2013 11:25 pm
by zip
Si senor