Skip to content

Commit 47ef21d

Browse files
committed
Update function documentation
1 parent ba6bb16 commit 47ef21d

File tree

2 files changed

+49
-10
lines changed

2 files changed

+49
-10
lines changed

HMS/source/getCategoryMetadata.brs

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
'********************************************************************
55

66
'*******************************************************************
7-
' Return a roArray of roAssociativeArrays for the selected category
7+
' Return a roArray of ContentNodes for the selected category
8+
' The list is sorted by title, and the ContentNode has the fields
9+
' setup for direct use with the VideoNode
10+
'
11+
' Pass the server url and the category (the subdirectory) to get the
12+
' metadata from.
813
'*******************************************************************
914
Function getCategoryMetadata(url As String, category As String) As Object
1015
cat_url = url + "/" + category + "/"
@@ -39,9 +44,14 @@ Function getCategoryMetadata(url As String, category As String) As Object
3944
return list
4045
End Function
4146

42-
'**********************************
43-
'** Return the type of the directory
44-
'**********************************
47+
'*********************************
48+
' Return the type of the directory
49+
'
50+
' 1 = photos
51+
' 2 = songs
52+
' 3 = episodes
53+
' 4 = movies
54+
'*********************************
4555
Function directoryType(listing_hash As Object) As Integer
4656
if listing_hash.DoesExist("photos") then
4757
return 1
@@ -55,8 +65,18 @@ Function directoryType(listing_hash As Object) As Integer
5565
return 0
5666
End Function
5767

68+
'**************************************************************
5869
' Get the poster name for the content type
59-
' First look for a specific .png or .jpg matching the file, then try 'default'
70+
'
71+
' First look for a specific .png or .jpg matching the basename,
72+
' then try 'default'
73+
'
74+
' Pass the full listing hash, the server url, basename of the
75+
' video, and content type. eg. SD, HD, FHD
76+
'
77+
' It returns the full url to the poster to use or "" if none
78+
' are found in the listing.
79+
'**************************************************************
6080
Function GetPosterURL(listing_hash as Object, url as String, basename as String, content as String) as String
6181
if listing_hash.DoesExist(basename+"-"+content+".png") then
6282
return url+basename+"-"+content+".png"
@@ -71,7 +91,15 @@ Function GetPosterURL(listing_hash as Object, url as String, basename as String,
7191
return ""
7292
End Function
7393

94+
'************************************************************
7495
' Get the bif file url for the content type
96+
'
97+
' Pass the full listing hash, the server url, basename of the
98+
' video, and content type. eg. SD, HD, FHD
99+
'
100+
' It returns the full url to the bif file or "" if none are
101+
' found in the listing.
102+
'************************************************************
75103
Function GetBifURL(listing_hash as Object, url as String, basename as String, content as String) as String
76104
if listing_hash.DoesExist(basename+"-"+content+".bif") then
77105
return url+basename+"-"+content+".bif"
@@ -80,9 +108,14 @@ Function GetBifURL(listing_hash as Object, url as String, basename as String, co
80108
return ""
81109
End Function
82110

83-
'******************************************
84-
'** Create an object with the movie metadata
85-
'******************************************
111+
'*****************************************************
112+
' Create an object with the movie metadata
113+
'
114+
' Return a ContentNode with all the fields
115+
' needed for use with the VideoNode setup.
116+
'
117+
' Pass the filename, server url, and full listing_hash
118+
'*****************************************************
86119
Function MovieObject(file As Object, url As String, listing_hash as Object) As Object
87120
o = CreateObject("roSGNode", "ContentNode")
88121
o.ContentType = "movie"

HMS/source/getDirectoryListing.brs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
'********************************************************************
2+
'** Home Media Server Application - Directory listing functions
3+
'** Copyright (c) 2010 Brian C. Lane All Rights Reserved.
4+
'********************************************************************
5+
16
' ********************************************************************
2-
' ** Parse an HTML directory listing
3-
' ** Copyright (c) 2010-2013 Brian C. Lane All Rights Reserved.
7+
' Parse an HTML directory listing
8+
'
9+
' Pass the server url, it returns an array of all the a href paths.
410
' ********************************************************************
511
Function getDirectoryListing(url As String) As Object
612
result = getHTMLWithTimeout(url, 60)

0 commit comments

Comments
 (0)