Small cleanup on content nodes

This commit is contained in:
Brahim Hadriche committed 2023-11-13 22:00:25 -05:00
1 parent 45da0880ba
commit 9f5a605e8f
4 files changed
+14 -16

No files matched your search

@@ -1,23 +1,23 @@
<component name="ChannelContentNode" extends="ContentNode">
<interface>
<function name="LoadChannel" />
<field id="type" type="string" value="channel" />
<field id="loadState" type="string" />
<function name="LoadChannel" />
<!-- index in a feed -->
<field id="feedSourcesIndex" type="integer" value="-1" />
<field id="HDItemWidth" type="float" value="196" />
<!-- NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation -->
<field id="_author" type="string" />
<field id="authorId" type="string" />
<field id="banner" type="string" />
<field id="channelHandle" type="string" />
<field id="description" type="string" />
<field id="subCount" type="integer" />
<field id="subCountText" type="string" />
<field id="tabs" type="array" />
<field id="thumbnail" type="string" />
<field id="videoCount" type="integer" />
<field id="videoCountText" type="string" />
<field id="thumbnail" type="string" />
<field id="banner" type="string" />
<field id="tabs" type="array" />
<field id="HDItemWidth" type="float" value="196" />
</interface>
</component>
@@ -4,9 +4,7 @@
<field id="loadState" type="string" />
<!-- index in a feed -->
<field id="feedSourcesIndex" type="integer" value="-1" />
<!--
TODO:P0 see if the existance of the field "title" has anything to do with it
<!--
For some strange reason, the "author" field can only be set once.
If you try to set it again, it will not be updated, with type mismatch warning:
@@ -24,17 +22,19 @@
Although we use the field "author" in other components, this is the only place where we modify it after
we set it for the first time (because a saved Playlist belongs to the Invidious user at first, but then
we can query it's original owner)
The issue happens on PlaylistContentNode and ChannelContentNode, but not VideoContentNode.
-->
<field id="_author" type="string" />
<field id="authorId" type="string" />
<field id="playlistId" type="string" />
<field id="thumbnail" type="uri" />
<field id="thumbnailBackground" type="uri" />
<field id="updated" type="integer" />
<field id="updatedText" type="string" />
<field id="videoCount" type="integer" value="-1" />
<field id="videoCountText" type="string" />
<field id="viewCount" type="integer" />
<field id="viewCountText" type="string" />
<field id="updated" type="integer" />
<field id="updatedText" type="string" />
</interface>
</component>
@@ -1,14 +1,13 @@
<component name="VideoContentNode" extends="ContentNode">
<interface>
<field id="type" type="string" value="video" />
<field id="author" type="string" />
<field id="authorId" type="string" />
<field id="hlsUrl" type="uri" />
<!-- index in a playlist -->
<field id="index" type="integer" value="-1" />
<!-- index in a feed -->
<field id="feedSourcesIndex" type="integer" value="-1" />
<field id="author" type="string" />
<field id="authorId" type="string" />
<field id="isUpcoming" type="boolean" />
<field id="lengthSeconds" type="integer" />
<field id="lengthText" type="string" />
@@ -35,7 +35,6 @@ namespace InvidiousContent
SetIfExists(node, "author", item, "author")
SetIfExists(node, "authorId", item, "authorId")
SetIfExists(node, "hlsUrl", item, "hlsUrl")
SetIfExists(node, "lengthSeconds", item, "lengthSeconds")
node.lengthText = TimeUtils.GetFormattedTime(item.lengthSeconds)
node.liveNow = VideoIsLive(item)