this is a dupe of the code in pvr.hts too btw. i'll clean that up next time.