import "pkg:/source/utils/Types.bs" function Init() m.videoCountRect = m.top.FindNode("videoCountRect") m.videoCountLabel = m.top.FindNode("videoCountLabel") end function function OnContentSet() as void content = m.top.itemContent if content = invalid return end if m.top.title = content.title ' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation. m.top.author = content._author m.top.updated = content.updatedText m.top.thumbnailUri = content.thumbnail videoCountText = content.videoCountText if content.videoCount = -1 and videoCountText = "" m.top.videoCountLabelVisible = false else m.top.videoCountLabelVisible = true SetVideoCount(videoCountText) end if end function function SetVideoCount(videoCountText as string) as void m.top.videoCount = videoCountText label = m.videoCountLabel rect = m.videoCountRect if label = invalid or rect = invalid return end if rectParent = rect.getParent() size = label.localBoundingRect() rect.width = size.width + 16 rect.translation = [rectParent.width - rect.width, rect.translation[1]] end function