xoceunder
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2017
02:27 PM
this error field
Warning occurred while setting a field of an RoSGNode
-- Type mismatch occurred when setting the "category" field of a "ParseEpg" node
at line 48 of file pkg:/components/ParseEpg/ParseEpg.brs
ParseEpg.brs
ParseEpg.xml
-- Type mismatch occurred when setting the "category" field of a "ParseEpg" node
at line 48 of file pkg:/components/ParseEpg/ParseEpg.brs
ParseEpg.brs
Function init()
m.top.functionName = "go"
m.top.control = "RUN"
End Function
Function go()
readInternet = createObject("roUrlTransfer")
m.content = createObject("RoSGNode","ContentNode")
readInternet.setUrl(m.top.uri)
source=readInternet.GetToString()
responseJSON = ParseJSON(source)
dateNow = CreateObject("roDateTime")
dateNow = dateNow.asSeconds() - 2000
Category=[]
numofcategories=responseJSON.Count()-1
For c=0 To numofcategories
Cat={}
Cat.Title=responseJSON[c].category
Cat.Id=responseJSON[c].cve
Category.Push(Cat)
if responseJSON[c].items <> invalid
For x=0 To responseJSON[c].items.Count()-1
itemAA=responseJSON[c].items[x]
'print itemAA.Title
m.channel = m.content.createChild("ContentNode")
m.channel.Title = itemAA.Title
m.channel.streamFormat = itemAA.streamFormat
m.channel.url = itemAA.StreamUrls
'm.channel.HDSMALLICONURL = itemAA.HDPosterURL
For e=0 To responseJSON[c].items[x].epg_now.Count()-1
epgNowAA=responseJSON[c].items[x].epg_now[e]
program = m.channel.createChild("ContentNode")
program.TITLE = epgNowAA.epg_after
program.PLAYSTART = dateNow + (e * 2000)
'program.PLAYDURATION = "2000"
Next
Next
end if
Next
m.top.content=m.content 'set top content field
m.top.category=Category 'set top content field
'print Category.Title
End Function
ParseEpg.xml
<?xml version="1.0" encoding="utf-8" ?>
<!--********** Copyright 2015 Roku Corp. All Rights Reserved. **********-->
<component name="ParseEpg" extends="Task">
<interface>
<field id="uri" type="uri" />
<field id="content" type="node" />
<field id="category" type="assocarray" />
</interface>
<script type="text/brightscript" uri="pkg:/components/ParseEpg/ParseEpg.brs"/>
</component>
2 REPLIES 2

24i
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2017
06:04 AM
Re: this error field
Hi xoceunder,
Incase you haven't found the issue yet, it seems like you are trying to assign an Array to an AssociativeArray field.
You should change:
To:
Since the 'Category' var is an Array and not an AssociativeArray
Incase you haven't found the issue yet, it seems like you are trying to assign an Array to an AssociativeArray field.
You should change:
<field id="category" type="assocarray" />
To:
<field id="category" type="array" />
Since the 'Category' var is an Array and not an AssociativeArray
xoceunder
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2017
06:41 PM
Re: this error field
Could make multiple alias to a field