[skip ci] small cleanup

This commit is contained in:
Brahim Hadriche committed 2025-06-12 09:40:34 -04:00
1 parent 8e71ededd2
commit a244cdee05
6 files changed
+10 -10

No files matched your search

@@ -404,7 +404,7 @@ function FetchSubscriptionStatus() as void
}) })
end function end function
function OnFetchSubscriptionStatusResult(result as object) as void function OnFetchSubscriptionStatusResult(_output as object) as void
m.fetchSubscriptionStatusTask = invalid m.fetchSubscriptionStatusTask = invalid
end function end function
@@ -51,6 +51,6 @@ function RefreshAccessToken() as void
}, OnProfileRefreshTokenTaskResult) }, OnProfileRefreshTokenTaskResult)
end function end function
function OnProfileRefreshTokenTaskResult(output as object) as void function OnProfileRefreshTokenTaskResult(_output as object) as void
m.refreshTokenTask = invalid m.refreshTokenTask = invalid
end function end function
@@ -70,7 +70,7 @@ function OnAccountsChanged() as void
m.accountList.content = content m.accountList.content = content
end function end function
function OnAccountSelected(event as object) as void function OnAccountSelected() as void
itemSelected = m.accountList.itemSelected itemSelected = m.accountList.itemSelected
itemNode = m.accountList.content.GetChild(itemSelected) itemNode = m.accountList.content.GetChild(itemSelected)
if itemNode = invalid if itemNode = invalid
@@ -977,7 +977,7 @@ namespace Innertube
return nodeData["tabs"] return nodeData["tabs"]
end function end function
function ParseTwoColumnRenderer(nodeData as object, context as object) as object function ParseTwoColumnRenderer(nodeData as object, _context as object) as object
' twoColumnRenderer is used for Playlists on TV. ' twoColumnRenderer is used for Playlists on TV.
' The right column has the videos (and continuation) ' The right column has the videos (and continuation)
' The left column has the playlist info (title, description, etc) which was already parsed ' The left column has the playlist info (title, description, etc) which was already parsed
@@ -1085,7 +1085,7 @@ namespace Innertube
"percentDurationWatched": percentDurationWatched "percentDurationWatched": percentDurationWatched
} }
authorId = ParseTileRendererAuthorId(nodeData, context) authorId = ParseTileRendererAuthorId(nodeData)
if authorId <> invalid if authorId <> invalid
video["authorId"] = authorId video["authorId"] = authorId
end if end if
@@ -1133,7 +1133,7 @@ namespace Innertube
"videoThumbnails": videoThumbnails "videoThumbnails": videoThumbnails
} }
authorId = ParseTileRendererAuthorId(nodeData, context) authorId = ParseTileRendererAuthorId(nodeData)
if authorId <> invalid if authorId <> invalid
video["authorId"] = authorId video["authorId"] = authorId
end if end if
@@ -1180,7 +1180,7 @@ namespace Innertube
"lines": renderedLines "lines": renderedLines
} }
authorId = ParseTileRendererAuthorId(nodeData, context) authorId = ParseTileRendererAuthorId(nodeData)
if authorId <> invalid if authorId <> invalid
playlist["authorId"] = authorId playlist["authorId"] = authorId
end if end if
@@ -1189,7 +1189,7 @@ namespace Innertube
return invalid return invalid
end function end function
function ParseTileRendererAuthorId(nodeData as object, context as object) as dynamic function ParseTileRendererAuthorId(nodeData as object) as dynamic
' We're checking in the long press menu if there's a browseId that starts with "UC". ' We're checking in the long press menu if there's a browseId that starts with "UC".
' This is usually the the id of the channel. ' This is usually the the id of the channel.
menuItems = ObjectUtils.Dig(nodeData, ["onLongPressCommand", "showMenuCommand", "menu", "menuRenderer", "items"]) menuItems = ObjectUtils.Dig(nodeData, ["onLongPressCommand", "showMenuCommand", "menu", "menuRenderer", "items"])
@@ -14,7 +14,7 @@ namespace SponsorBlock
return invalid return invalid
end function end function
function ShowNotifcation(notifications as object, segment as object, action as dynamic) as void function ShowNotifcation(notifications as object, segment as object) as void
' TODO:P2 avoid finding the node over and over ' TODO:P2 avoid finding the node over and over
' The video player can probably own a single notification, and destroy it when the video is closed ' The video player can probably own a single notification, and destroy it when the video is closed
notification = GetCurrentNotification(notifications) notification = GetCurrentNotification(notifications)
@@ -142,7 +142,7 @@ namespace SponsorBlock
' a notification, since it is possible this is where we skipped to. ' a notification, since it is possible this is where we skipped to.
' Seeking is not super accurate. ' Seeking is not super accurate.
if segment.showNotification and Abs(segment.end - position) >= 1 if segment.showNotification and Abs(segment.end - position) >= 1
SponsorBlock.ShowNotifcation(m.notifications, segment, action) SponsorBlock.ShowNotifcation(m.notifications, segment)
if action = SegmentAction.ManualSkip if action = SegmentAction.ManualSkip
' We'll save the segment here, and handle it in case the user ' We'll save the segment here, and handle it in case the user