From bed8223e760f17b71c78645bb38751a764563be3 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sun, 22 Dec 2024 16:04:36 -0500 Subject: [PATCH] [Part 2] Innertube (#513) * Parse author in videoRenderer * Parse more fields * Parse live badge * playlist video count * Parse more things * parse playlists and albums * More parsing work * announcement and changelog * Lint fix --------- Co-authored-by: github-action linter --- CHANGELOG.md | 4 +- .../src/components/ChannelView/ChannelView.bs | 8 +- .../ContentNode/ChannelContentNode.xml | 1 + .../ContentNode/PlaylistContentNode.xml | 1 + playlet-lib/src/components/MainScene.bs | 23 ++ .../src/components/MainScene.transpiled.brs | 24 ++ .../components/PlaylistView/PlaylistView.bs | 9 +- .../Services/Innertube/NodesParser.bs | 288 +++++++++++++++++- .../components/Services/Innertube/Parser.bs | 43 ++- .../Invidious/InvidiousToContentNode.bs | 19 +- .../VideoFeed/VideoRowCell/ChannelRowCell.bs | 18 +- .../VideoFeed/VideoRowCell/ChannelRowCell.xml | 7 +- .../VideoFeed/VideoRowCell/PlaylistRowCell.bs | 5 +- .../VideoFeed/VideoRowCell/VideoRowCell.bs | 19 +- playlet-lib/src/source/utils/ObjectUtils.bs | 8 +- playlet-lib/src/source/utils/TimeUtils.bs | 4 +- 16 files changed, 444 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d26893de..9bfa2a45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Built-in Playlet backend, which supports channels, playlists, and search - - This backend is not finished, and provides the bare minimum to watch videos. - - More features to come. + - This backend is experimental, and has a few missing features. + - To use it, set the Invidious instance to an empty string. ### Fixed diff --git a/playlet-lib/src/components/ChannelView/ChannelView.bs b/playlet-lib/src/components/ChannelView/ChannelView.bs index 72d8612c..39e45da4 100644 --- a/playlet-lib/src/components/ChannelView/ChannelView.bs +++ b/playlet-lib/src/components/ChannelView/ChannelView.bs @@ -66,7 +66,13 @@ function OnContentSet() as void ' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation. m.authorLabel.text = content._author - m.subCountLabel.text = content.subCountText + + subCountText = content.authorSubTitle + if StringUtils.IsNullOrEmpty(subCountText) + subCountText = content.subCountText + end if + m.subCountLabel.text = subCountText + m.banner.uri = content.banner if StringUtils.IsNullOrEmpty(content.thumbnail) m.thumbnail.uri = "" diff --git a/playlet-lib/src/components/ContentNode/ChannelContentNode.xml b/playlet-lib/src/components/ContentNode/ChannelContentNode.xml index ac6ffc8a..ec1e7474 100644 --- a/playlet-lib/src/components/ContentNode/ChannelContentNode.xml +++ b/playlet-lib/src/components/ContentNode/ChannelContentNode.xml @@ -10,6 +10,7 @@ +