A couple of small fixes

This commit is contained in:
Brahim Hadriche committed 2024-12-31 15:38:53 -05:00
1 parent 7baa95141a
commit 5eefb9f6cd
4 files changed
+17 -17

No files matched your search

@@ -907,7 +907,7 @@ namespace Innertube
return invalid
end function
function ParseAppendContinuationItemsAction(nodeData as object, context as object) as object
function ParseAppendContinuationItemsAction(nodeData as object, _context as object) as object
return nodeData["continuationItems"]
end function
@@ -16,13 +16,7 @@ function OnContentSet() as void
m.top.title = content.title
m.top.thumbnailUri = content.thumbnail
if ValidInt(content.lengthSeconds) <> 0
SetDurationText(content.lengthText)
m.top.durationRectVisible = true
else
m.top.durationRectVisible = false
end if
SetDurationText(content.lengthText)
SetHighlight()
end function
@@ -31,6 +25,12 @@ function OnIndexSet() as void
end function
function SetDurationText(text as string) as void
hasText = text <> ""
m.top.durationRectVisible = hasText
if not hasText
return
end if
m.top.duration = text
label = m.durationLabel
@@ -71,12 +71,6 @@ namespace Http
return true
end if
lengthSeconds = metadata.lengthSeconds
if not IsInt(lengthSeconds)
response.Default(500, "Player metadata lengthSeconds is invalid")
return true
end if
index = request.query.index
if StringUtils.IsNullOrEmpty(index)
response.Default(400, "Missing index")
@@ -90,7 +84,7 @@ namespace Http
end if
storyboard = storyboards[index]
hlsManifest = m.GenerateStoryboardManifest(storyboard, lengthSeconds)
hlsManifest = m.GenerateStoryboardManifest(storyboard)
response.http_code = 200
response.SetBodyDataString(hlsManifest)
@@ -187,7 +181,7 @@ namespace Http
return hlsManifest.Replace("VIDEO-RANGE=HLG", "VIDEO-RANGE=SDR").Replace("VIDEO-RANGE=PQ", "VIDEO-RANGE=SDR")
end function
function GenerateStoryboardManifest(storyboard as object, lengthSeconds as float) as string
function GenerateStoryboardManifest(storyboard as object) as string
tileCount = storyboard.storyboardWidth * storyboard.storyboardHeight
intervalSeconds = Cdbl(storyboard.interval) / 1000.0
targetDuration = tileCount * intervalSeconds