HMS

Home Media Server for Roku Players
git clone https://www.brianlane.com/git/HMS
Log | Files | Refs | README | LICENSE

commit 4a3797118b601f3ffdc88805401d2df31974f49f
parent b05d141c0df5f9c9afaf796a62ef2bfb4de6022e
Author: Brian C. Lane <bcl@brianlane.com>
Date:   Fri, 15 Oct 2010 07:19:26 -0700

App fires up and gets initial directory listing

Diffstat:
MHMS/source/appDisplayDirectory.brs | 13++++++-------
MHMS/source/appMain.brs | 2+-
MHMS/source/getDirectoryListing.brs | 4++--
3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/HMS/source/appDisplayDirectory.brs b/HMS/source/appDisplayDirectory.brs @@ -9,14 +9,13 @@ Sub displayDirectory( url ) As Void ' Get the directory listing + listing = getDirectoryListing(url) + if listing = invalid then + print "Failed to get directory listing for"; url + return + end if - ' If there is an error, show a dialog to the user - - ' What kind of directory display should be shown? - - ' - - + print listing End Sub diff --git a/HMS/source/appMain.brs b/HMS/source/appMain.brs @@ -10,7 +10,7 @@ Sub Main() 'initialize theme attributes like titles, logos and overhang color initTheme() - if not checkServerUrl() then + if not checkServerUrl(false) then ' Need to show an error to the user here and exit when they click done print "Server URL is invalid" return diff --git a/HMS/source/getDirectoryListing.brs b/HMS/source/getDirectoryListing.brs @@ -21,13 +21,13 @@ Sub getDirectoryListing(url as String) As Object end if ' grab all the <a href /> elements - urls = getUrls([], rsp) + urls = getUrls({}, rsp) return urls End Sub Sub getUrls(array as Object, element as Object) As Object if element.GetName() = "a" and element.HasAttribute("href") then - array.Push(element.GetAttributes()["href"]) + array.AddReplace(element.GetAttributes()["href"], "") end if if element.GetChildElements()<>invalid then for each e in element.GetChildElements()