From 5eefb9f6cd18b6efd28822f2da78693aec4bcd26 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Tue, 31 Dec 2024 15:38:53 -0500 Subject: [PATCH] A couple of small fixes --- CHANGELOG.md | 8 +++++++- .../components/Services/Innertube/NodesParser.bs | 2 +- .../components/VideoQueue/VideoQueueViewCell.bs | 14 +++++++------- .../Web/PlayletWebServer/Middleware/HlsRouter.bs | 10 ++-------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abd57191..27b92522 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing worth mentioning yet. +### Added + +- German translation (Thanks to Lacey Anaya) + +### Fixed + +- Video duration in queue view ## [0.35.3] - 2024-12-29 diff --git a/playlet-lib/src/components/Services/Innertube/NodesParser.bs b/playlet-lib/src/components/Services/Innertube/NodesParser.bs index e7273f0a..e1146fc0 100644 --- a/playlet-lib/src/components/Services/Innertube/NodesParser.bs +++ b/playlet-lib/src/components/Services/Innertube/NodesParser.bs @@ -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 diff --git a/playlet-lib/src/components/VideoQueue/VideoQueueViewCell.bs b/playlet-lib/src/components/VideoQueue/VideoQueueViewCell.bs index 4fbff0be..a2820beb 100644 --- a/playlet-lib/src/components/VideoQueue/VideoQueueViewCell.bs +++ b/playlet-lib/src/components/VideoQueue/VideoQueueViewCell.bs @@ -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 diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HlsRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HlsRouter.bs index a7b9c5a9..24e07bbc 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HlsRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HlsRouter.bs @@ -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