I've tried modifying the CATEGORIES function like this:
Code:
def CATEGORIES():
strUrl = 'http://' + __settings__.getSetting("sage_user") + ':' + __settings__.getSetting("sage_pass") + '@' + __settings__.getSetting("sage_ip") + ':' + __settings__.getSetting("sage_port")
addDir('All Shows', strUrl + '/sage/Recordings?xml=yes',2,'icon.png')
addDir('Safety Patrol',strUrl + '/sage/Search?searchType=TVFiles&SearchString=Safety%20Patrol&DVD=on&sort2=airdate_asc&TimeRange=0&pagelen=100&sort1=title_asc&filename=&Video=on&search_fields=title&xml=yes',2,'dailyshow.jpg')
addDir('Sports',strUrl + '/sage/Search?searchType=TVFiles&Categories=Sports+event&SearchString=&xml=yes',2,'sports.jpg')
addDir('The Daily Show',strUrl + '/sage/Search?searchType=TVFiles&SearchString=Daily%20show&DVD=on&sort2=airdate_asc&TimeRange=0&pagelen=100&sort1=title_asc&filename=&Video=on&search_fields=title&xml=yes',2,'dailyshow.jpg')
req = urllib.urlopen(strUrl + '/sage/Search?SearchString=&searchType=TVFiles&Video=on&xml=yes')
content = parse(req)
for showlist in content.getElementsByTagName('show'):
strTitle= ''
strTitleSearch = ''
strCheckTitle = ''
for shownode in showlist.childNodes:
# Get the title of the show
if (shownode.nodeName == 'title') and (shownode.nodeName != strCheckTitle):
strTitle = shownode.toxml()
strTitle = strTitle.replace('<title>','')
strTitle = strTitle.replace('</title>','')
strTitle = strTitle.replace('&','&')
strTitleSearch = strTitle.replace(' ','%20')
strCheckTitle = StrTitle
addDir(strTitle,strUrl + '/sage/Search?searchType=TVFiles&SearchString=' + strTitleSearch + '&DVD=on&sort2=airdate_asc&TimeRange=0&pagelen=100&sort1=title_asc&filename=&Video=on&search_fields=title&xml=yes',2,'dailyshow.jpg')
The first few lines were just a test to see if I could get the folders to appear. They did and it works great. I then tried copying a portion from VIDEOLINKS function to try and pull the title names from a generic show-all-recordings type query on the sage server. I'm doing a check to make sure we only send the title once to the addDir function. I'm getting an error but I'm not sure where. Can someone spot what I'm doing wrong? I'm a hacker, not a programmer, so any help would be great.