From 68a4f9fade8d9f522499a6f9b5a1aac6c77fbb17 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Wed, 21 May 2025 21:21:42 -0400 Subject: [PATCH] Show lines in playlist view --- CHANGELOG.md | 4 ++++ .../ContentNode/VideoContentNode.xml | 3 +++ .../PlaylistView/PlaylistViewCell.bs | 19 ++++++++++++++++++- .../PlaylistView/PlaylistViewCell.xml | 5 +++-- .../Services/Innertube/NodesParser.bs | 2 ++ .../Invidious/InvidiousToContentNode.bs | 1 + 6 files changed, 31 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49944116..9a24ffb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - German translation +### Fixed + +- Display issue in playlist view + ## [0.38.1] - 2025-05-20 ### Fixed diff --git a/playlet-lib/src/components/ContentNode/VideoContentNode.xml b/playlet-lib/src/components/ContentNode/VideoContentNode.xml index 07c1c2be..7b14e400 100644 --- a/playlet-lib/src/components/ContentNode/VideoContentNode.xml +++ b/playlet-lib/src/components/ContentNode/VideoContentNode.xml @@ -22,7 +22,10 @@ + + + \ No newline at end of file diff --git a/playlet-lib/src/components/PlaylistView/PlaylistViewCell.bs b/playlet-lib/src/components/PlaylistView/PlaylistViewCell.bs index 3c34a287..fd8d8c2c 100644 --- a/playlet-lib/src/components/PlaylistView/PlaylistViewCell.bs +++ b/playlet-lib/src/components/PlaylistView/PlaylistViewCell.bs @@ -1,3 +1,4 @@ +import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/TimeUtils.bs" import "pkg:/source/utils/Types.bs" @@ -15,7 +16,23 @@ function OnContentSet() as void m.top.title = content.title ' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation. - m.top.author = content._author + author = content._author + if not StringUtils.IsNullOrEmpty(author) + videoInfo = content.videoInfo + if not StringUtils.IsNullOrEmpty(videoInfo) + author += `\n` + videoInfo + end if + else + lines = content.lines + if IsArray(lines) and lines.Count() > 0 + author = lines[0] + if lines.Count() > 1 + author += `\n` + lines[1] + end if + end if + end if + m.top.author = author + m.top.thumbnailUri = content.thumbnail SetDurationText(content.lengthText) diff --git a/playlet-lib/src/components/PlaylistView/PlaylistViewCell.xml b/playlet-lib/src/components/PlaylistView/PlaylistViewCell.xml index a42793c5..8c5f2c22 100644 --- a/playlet-lib/src/components/PlaylistView/PlaylistViewCell.xml +++ b/playlet-lib/src/components/PlaylistView/PlaylistViewCell.xml @@ -44,8 +44,9 @@