Refresh lint rules (#238)

* Lint

* Color rules

* Update sponsorblock config file

* Small tweak

* Color adjustments
This commit is contained in:
Brahim Hadriche authored and GitHub committed 2023-12-22 19:36:36 -05:00
1 parent cbda8dbf9b
commit e53ad785c6
89 files changed
+445 -468

No files matched your search

@@ -135,8 +135,8 @@ function OnSubscribeButtonSelected()
isSubbed = IsSubscribed()
m.subscribeTask = StartAsyncTask(SubscribeTask, {
invidious: m.invidious,
ucid: m.authorId,
invidious: m.invidious
ucid: m.authorId
subscribe: not isSubbed
})
end function
@@ -172,19 +172,19 @@ function InitializeTabs()
m.tabs = {
videos: function(authorId as string, author as string) as object
return CreateChannelFeed("Latest videos", "channel_videos", authorId, author)
end function,
end function
shorts: function(authorId as string, author as string) as object
return CreateChannelFeed("Shorts", "channel_shorts", authorId, author)
end function,
end function
streams: function(authorId as string, author as string) as object
return CreateChannelFeed("Live", "channel_streams", authorId, author)
end function,
end function
podcasts: function(authorId as string, author as string) as object
return CreateChannelFeed("Podcasts", "channel_podcasts", authorId, author)
end function,
end function
playlists: function(authorId as string, author as string) as object
return CreateChannelFeed("Playlists", "channel_playlists", authorId, author)
end function,
end function
channels: function(authorId as string, author as string) as object
return CreateChannelFeed("Channels", "channel_channels", authorId, author)
end function
@@ -193,12 +193,12 @@ end function
function CreateChannelFeed(title as string, endpoint as string, ucid as string, author as string) as object
return {
title: title,
title: title
feedSources: [{
"id": `inv_${endpoint}_${ucid}`,
"title": `${author} - ${title}`,
"apiType": "Invidious",
"endpoint": endpoint,
"id": `inv_${endpoint}_${ucid}`
"title": `${author} - ${title}`
"apiType": "Invidious"
"endpoint": endpoint
"pathParams": {
"ucid": ucid
}
@@ -22,7 +22,7 @@ function SubscribeTask(input as object) as object
error = response.ErrorMessage()
LogError("Failed to subscribe/unsubscribe to channel:", error)
return {
success: false,
success: false
error: error
}
end if
@@ -18,7 +18,7 @@ function LoadChannel(invidiousNode as object) as void
m.top.loadState = FeedLoadState.Loading
m.contentTask = StartAsyncTask(ChannelContentTask, {
content: m.top,
content: m.top
invidious: invidiousNode
}, OnChannelContentTaskResult)
end function
@@ -24,7 +24,7 @@ function ChannelContentTask(input as object) as object
if not response.IsSuccess() or metadata = invalid
contentNode.loadState = FeedLoadState.Error
return {
success: false,
success: false
error: response.ErrorMessage()
}
end if
@@ -11,19 +11,19 @@ function OnItemHasFocus()
hasFocus = m.top.itemHasFocus
if hasFocus
m.top.font = "font:SmallestBoldSystemFont"
m.top.color = "0x262626ff"
m.top.color = "#262626ff"
else
m.top.font = "font:SmallestSystemFont"
m.top.color = "0xddddddff"
m.top.color = "#DBDBDBFF"
end if
end function
function OnFocusPercent()
if m.top.focusPercent > 0.5
m.top.font = "font:SmallestBoldSystemFont"
m.top.color = "0x262626ff"
m.top.color = "#262626FF"
else
m.top.font = "font:SmallestSystemFont"
m.top.color = "0xddddddff"
m.top.color = "#DBDBDBFF"
end if
end function
@@ -1,12 +1,12 @@
function SetPalette(dialog as object)
palette = createObject("roSGNode", "RSGPalette")
palette.colors = {
DialogBackgroundColor: "#242424FF",
DialogFocusColor: "#CECECEFF",
DialogFocusItemColor: "#202020FF",
DialogSecondaryTextColor: "#F8F8F8FF",
DialogSecondaryItemColor: "0xFF1C30FF",
DialogTextColor: "#EEEEEEFF"
DialogBackgroundColor: "#242424FF"
DialogFocusColor: "#CECECEFF"
DialogFocusItemColor: "#202020FF"
DialogSecondaryTextColor: "#DBDBDBFF"
DialogSecondaryItemColor: "#FF1C30FF"
DialogTextColor: "#DBDBDBFF"
}
dialog.palette = palette
end function
@@ -34,9 +34,9 @@ function OnUrlSet()
m.urlLabel.text = url
StartAsyncTask(GenerateQrCodeTask, {
poster: m.qrCode,
text: url,
size: m.qrCode.loadWidth,
poster: m.qrCode
text: url
size: m.qrCode.loadWidth
padding: 10
})
end function
+2 -3
View File
@@ -1,4 +1,3 @@
import "pkg:/source/utils/ColorUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Types.bs"
@@ -31,8 +30,8 @@ function PopulateButtons() as void
buttons = []
for each item in navBarItems
button = CreateObject("roSGNode", "IconButton")
button.background = ColorUtils.HexToInt("242424")
button.focusBackground = ColorUtils.HexToInt("FF1C30")
button.background = "#242424FF"
button.focusBackground = "#FF1C30FF"
button.padding = 20
button.height = 50
button.width = 90
@@ -3,7 +3,7 @@ const OPTIONS_LONG_PRESS_KEY = "OPTIONS_LONG_PRESS"
function InitializeLongPress(keys as object, duration = 1.0 as float)
longPressKeyMap = {
"OK": OK_LONG_PRESS_KEY,
"OK": OK_LONG_PRESS_KEY
"options": OPTIONS_LONG_PRESS_KEY
}
m._longPressKeyMap = {}
@@ -17,7 +17,7 @@ function InitializeLongPress(keys as object, duration = 1.0 as float)
' - press K to simulate an "OK" long press on the remote.
' - press O to simulate an "options" long press on the remote.
simulatedLongPressKeyMap = {
"OK": "Lit_k",
"OK": "Lit_k"
"options": "Lit_o"
}
@@ -10,8 +10,8 @@ function SetNavigation(fromNode as object, direction as string, toNode as object
end if
m._navigation[direction].push({
fromNode: fromNode,
toNode: toNode,
fromNode: fromNode
toNode: toNode
callback: callback
})
end function
@@ -19,7 +19,7 @@ end function
function NavigationKeyHandler(key as string, press as boolean) as object
if not press
return {
handled: false,
handled: false
node: invalid
}
end if
@@ -27,7 +27,7 @@ function NavigationKeyHandler(key as string, press as boolean) as object
navigations = m._navigation[key]
if navigations = invalid
return {
handled: false,
handled: false
node: invalid
}
end if
@@ -41,13 +41,13 @@ function NavigationKeyHandler(key as string, press as boolean) as object
item.callback()
end if
return {
handled: true,
handled: true
node: item.toNode
}
end if
end for
return {
handled: false,
handled: false
node: invalid
}
end function
@@ -68,26 +68,26 @@ function GetQueue(_unused as dynamic) as object
nodeType = node.type
if nodeType = "video"
items.push({
type: nodeType,
videoId: node.videoId,
title: node.title,
author: node.author,
type: nodeType
videoId: node.videoId
title: node.title
author: node.author
thumbnail: node.thumbnail
})
else if node.type = "playlist"
items.push({
type: nodeType,
playlistId: node.playlistId,
title: node.title,
thumbnail: node.thumbnail,
type: nodeType
playlistId: node.playlistId
title: node.title
thumbnail: node.thumbnail
videoCountText: node.videoCountText
})
end if
end for
return {
index: m.top.index,
playlistIndex: m.top.playlistIndex,
index: m.top.index
playlistIndex: m.top.playlistIndex
items: items
}
end function
@@ -189,7 +189,7 @@ function LoadPlaylist(playlist as object) as void
playlist.loadState = FeedLoadState.Loading
task = StartAsyncTask(PlaylistContentTask, {
content: playlist,
content: playlist
invidious: m.top.invidious
}, OnPlaylistContentTaskResult)
m.pendingLoadTasks[task.id] = task
@@ -66,6 +66,7 @@ function SetHighlight() as void
index = m.top.index
if playQueueIndex = index
' bs:disable-next-line LINT3023
m.top.thumbnailBlendColor = "#FFFFFFFF"
m.top.highlightUri = "pkg:/images/focus_grid.9.png"
else
@@ -27,7 +27,7 @@ function PlaylistContentTask(input as object) as object
if not response.IsSuccess() or metadata = invalid
contentNode.loadState = FeedLoadState.Error
return {
success: false,
success: false
error: response.ErrorMessage()
}
end if
@@ -223,7 +223,7 @@ function LoadPlaylist() as void
m.top.content.loadState = FeedLoadState.Loading
m.playlistLoadTask = StartAsyncTask(PlaylistContentTask, {
content: m.top.content,
content: m.top.content
invidious: m.top.invidious
}, OnPlaylistContentTaskResult)
end function
@@ -3,28 +3,28 @@ import "pkg:/source/asyncTask/asyncTask.bs"
function Init()
' TODO:P2 Add tooltip to each field with description of what it means
m.displayNames = [{
key: "app_version",
key: "app_version"
displayText: "Playlet App Version"
}, {
key: "lib_version",
key: "lib_version"
displayText: "Playlet Library Version"
}, {
key: "lib_version_latest",
key: "lib_version_latest"
displayText: "Playlet Library Latest Version"
}, {
key: "lib_url",
key: "lib_url"
displayText: "Playlet Library URL"
}, {
key: "lib_url_type",
key: "lib_url_type"
displayText: "Playlet Library URL Type"
}, {
key: "app_git_commit_hash",
key: "app_git_commit_hash"
displayText: "Playlet App Git Commit Hash"
}, {
key: "lib_git_commit_hash",
key: "lib_git_commit_hash"
displayText: "Playlet Library Git Commit Hash"
}, {
key: "id",
key: "id"
displayText: "App ID"
}]
@@ -79,7 +79,7 @@ function SetRowListContent(bookmarksContent as object)
end for
feeds.push({
"title": bookmarkGroupNode.title,
"title": bookmarkGroupNode.title
"feedSources": feedSources
})
end for
@@ -5,110 +5,110 @@ import "pkg:/source/utils/Types.bs"
function Init()
options = {
date: [{
title: "Any date",
title: "Any date"
value: ""
}, {
title: "Last hour",
title: "Last hour"
value: "hour"
}, {
title: "Today",
title: "Today"
value: "today"
}, {
title: "This week",
title: "This week"
value: "week"
}, {
title: "This month",
title: "This month"
value: "month"
}, {
title: "This year",
title: "This year"
value: "year"
}],
}]
type: [{
title: "Any type",
title: "Any type"
value: ""
}, {
title: "Video",
title: "Video"
value: "video"
}, {
title: "Playlist",
title: "Playlist"
value: "playlist"
}, {
title: "Channel",
title: "Channel"
value: "channel"
}, {
title: "Movie",
title: "Movie"
value: "movie"
}, {
title: "Show",
title: "Show"
value: "show"
}],
}]
duration: [{
title: "Any duration",
title: "Any duration"
value: ""
}, {
title: "Under 4 minutes",
title: "Under 4 minutes"
value: "short"
}, {
title: "4 - 20 minutes",
title: "4 - 20 minutes"
value: "medium"
}, {
title: "Over 20 minutes",
title: "Over 20 minutes"
value: "long"
}],
}]
features: [{
title: "Live",
title: "Live"
value: "live"
}, {
title: "4K",
title: "4K"
value: "4k"
}, {
title: "HD",
title: "HD"
value: "hd"
}, {
title: "Subtitles/CC",
title: "Subtitles/CC"
value: "subtitles"
}, {
title: "Creative Commons",
title: "Creative Commons"
value: "creative_commons"
}, {
title: "360°",
title: "360°"
value: "360"
}, {
title: "VR180",
title: "VR180"
value: "vr180"
}, {
title: "3D",
title: "3D"
value: "3d"
}, {
title: "HDR",
title: "HDR"
value: "hdr"
}, {
title: "Purchased",
title: "Purchased"
value: "purchased"
}, {
title: "Location",
title: "Location"
value: "location"
}],
}]
sort_by: [{
title: "Relevance",
title: "Relevance"
value: ""
}, {
title: "Upload date",
title: "Upload date"
value: "upload_date"
}, {
title: "View count",
title: "View count"
value: "view_count"
}, {
title: "Rating",
title: "Rating"
value: "rating"
}]
}
m.controls = {
date: m.top.findNode("UploadDateList"),
type: m.top.findNode("TypeList"),
duration: m.top.findNode("DurationList"),
features: m.top.findNode("FeaturesList"),
date: m.top.findNode("UploadDateList")
type: m.top.findNode("TypeList")
duration: m.top.findNode("DurationList")
features: m.top.findNode("FeaturesList")
sort_by: m.top.findNode("SortByList")
}
@@ -118,10 +118,10 @@ function Init()
end for
m.contentNodes = {
date: m.controls.date.content,
type: m.controls.type.content,
duration: m.controls.duration.content,
features: m.controls.features.content,
date: m.controls.date.content
type: m.controls.type.content
duration: m.controls.duration.content
features: m.controls.features.content
sort_by: m.controls.sort_by.content
}
@@ -25,10 +25,10 @@ function Init()
textEditBox.voiceEnabled = true
m.top.filters = {
date: "",
type: "",
duration: "",
features: [],
date: ""
type: ""
duration: ""
features: []
sort_by: ""
}
@@ -99,8 +99,8 @@ function OnTextChange() as void
end if
m.searchSuggestionsTask = StartAsyncTask(SearchSuggestionsTask, {
q: m.keyboard.text,
invidious: m.invidious,
q: m.keyboard.text
invidious: m.invidious
preferences: m.preferences
}, OnSearchSuggestionsTaskResults)
end function
@@ -206,10 +206,10 @@ function Search(text as string)
ShowLoadingScreen()
feedSource = {
"id": `inv_search_${CryptoUtils.GetMd5(text)}`,
"title": `Search - ${text}`,
"apiType": "Invidious",
"endpoint": "search",
"id": `inv_search_${CryptoUtils.GetMd5(text)}`
"title": `Search - ${text}`
"apiType": "Invidious"
"endpoint": "search"
"queryParams": {
"q": text
}
@@ -222,14 +222,14 @@ function Search(text as string)
feedSource.queryParams[filter] = value
else if IsArray(value) and value.Count() > 0
feedSource.queryParams[filter] = {
value: value,
value: value
arrayType: UrlUtils.QueryParamArrayType.CommaSeparated
}
end if
end for
m.rowList.feeds = [{
"title": `Search - ${text}`,
"title": `Search - ${text}`
"feedSources": [feedSource]
}]
end function
@@ -26,7 +26,7 @@ function SearchSuggestionsTask(input as object) as object
end if
return {
q: q,
q: q
response: history
}
end function
@@ -58,7 +58,7 @@ function RunTestsTask()
end if
m.testingTask = StartAsyncTask(InvidiousInstanceTestingTask, {
instance: m.top.instance,
instance: m.top.instance
listNode: m.testList
})
end function
@@ -38,9 +38,9 @@ function CreateTestNode(title as string, func as function) as object
testNode = CreateObject("roSGNode", "ContentNode")
testNode.title = title
testNode.AddFields({
func: FuncName(func),
state: "loading",
details: "",
func: FuncName(func)
state: "loading"
details: ""
duration: 0
})
m[testNode.func] = func
@@ -15,7 +15,7 @@ function InvidiousPublicInstancesTask(input as object) as object
if not response.IsSuccess() or instances = invalid
return {
success: false,
success: false
error: response.ErrorMessage()
}
end if
@@ -31,14 +31,14 @@ function InvidiousPublicInstancesTask(input as object) as object
for each instance in instances
item = CreateObject("roSGNode", "InvidiousPublicInstancesListItemContent")
item.setFields({
name: instance[0],
version: instance[1].stats.software.version,
users: instance[1].stats.usage.users.total,
signup: instance[1].stats.openRegistrations ? "Yes" : "No",
name: instance[0]
version: instance[1].stats.software.version
users: instance[1].stats.usage.users.total
signup: instance[1].stats.openRegistrations ? "Yes" : "No"
' Leave 5 spaces for the flag, just to simplify the layout
location: ` ${instance[1].region}`,
flag: GetFlagUrl(instance[1].flag),
health: instance[1].monitor["30dRatio"].ratio,
location: ` ${instance[1].region}`
flag: GetFlagUrl(instance[1].flag)
health: instance[1].monitor["30dRatio"].ratio
uri: instance[1].uri
})
content.AppendChild(item)
@@ -8,9 +8,9 @@ function Init()
m.scrollAnimation = m.top.findNode("scrollAnimation")
m.scrollAnimationInterpolator = m.scrollAnimation.findNode("scrollAnimationInterpolator")
m.viewport = {
x: 150,
y: 96,
width: 1920,
x: 150
y: 96
width: 1920
height: 550
}
end function
@@ -75,7 +75,7 @@ function CreateCategoryNode(item as object, container as object, startX as integ
node.displayText = item.displayText
node.description = item.description
return {
node: node,
node: node
rect: node.boundingRect()
}
end function
@@ -107,11 +107,11 @@ function CreateControls(item as object, container as object, startX as integer,
end for
return {
nodes: nodes,
nodes: nodes
rect: {
x: x,
y: y,
width: width,
x: x
y: y
width: width
height: height
}
}
@@ -142,7 +142,7 @@ function CreateControl(item as object, container as object, startX as integer, s
control@.BindPreference(m.preferences, item.key)
return {
node: control,
node: control
rect: control.boundingRect()
}
end function
@@ -23,9 +23,9 @@ function OnUrlSet()
qrCodePoster = m.top.findNode("QrCodePoster")
StartAsyncTask(GenerateQrCodeTask, {
poster: qrCodePoster,
text: url,
size: qrCodePoster.loadWidth,
poster: qrCodePoster
text: url
size: qrCodePoster.loadWidth
padding: 20
})
end function
@@ -53,18 +53,18 @@ function Save() as void
bookmarkNodes = bookmarkGroupNode.getChildren(-1, 0)
for each bookmarkNode in bookmarkNodes
bookmarks.push({
"id": bookmarkNode.id,
"id": bookmarkNode.id
"feedSource": bookmarkNode.feedSource
})
end for
groups.push({
"title": bookmarkGroupNode.title,
"title": bookmarkGroupNode.title
"bookmarks": bookmarks
})
end for
bookmarksString = FormatJson({
"__version": m.top.__version,
"__version": m.top.__version
"groups": groups
})
@@ -110,8 +110,8 @@ function AddVideoBookmark(id as string, groupName as string)
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
feedSource = {
"apiType": "Invidious",
"endpoint": "video_info",
"apiType": "Invidious"
"endpoint": "video_info"
"pathParams": {
"id": id
}
@@ -123,8 +123,8 @@ function AddPlaylistBookmark(id as string, groupName as string)
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
feedSource = {
"apiType": "Invidious",
"endpoint": "playlist_info",
"apiType": "Invidious"
"endpoint": "playlist_info"
"pathParams": {
"plid": id
}
@@ -136,10 +136,10 @@ function AddPlaylistBookmarkWithSpread(id as string, groupName as string)
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
feedSource = {
"id": `inv_playlist_${id}`,
"title": `${groupName} videos`,
"apiType": "Invidious",
"endpoint": "playlist",
"id": `inv_playlist_${id}`
"title": `${groupName} videos`
"apiType": "Invidious"
"endpoint": "playlist"
"pathParams": {
"plid": id
}
@@ -147,8 +147,8 @@ function AddPlaylistBookmarkWithSpread(id as string, groupName as string)
AddFeedSourceBookmark(feedSource, `inv_playlist_${id}`, bookmarkGroupNode)
feedSource = {
"apiType": "Invidious",
"endpoint": "playlist_info",
"apiType": "Invidious"
"endpoint": "playlist_info"
"pathParams": {
"plid": id
}
@@ -160,8 +160,8 @@ function AddChannelBookmark(id as string, groupName as string)
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
feedSource = {
"apiType": "Invidious",
"endpoint": "channel_info",
"apiType": "Invidious"
"endpoint": "channel_info"
"pathParams": {
"ucid": id
}
@@ -173,10 +173,10 @@ function AddChannelBookmarkWithSpread(id as string, groupName as string)
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
feedSource = {
"id": `inv_channel_videos_${id}`,
"title": `${groupName} videos`,
"apiType": "Invidious",
"endpoint": "channel_videos",
"id": `inv_channel_videos_${id}`
"title": `${groupName} videos`
"apiType": "Invidious"
"endpoint": "channel_videos"
"pathParams": {
"ucid": id
}
@@ -184,8 +184,8 @@ function AddChannelBookmarkWithSpread(id as string, groupName as string)
AddFeedSourceBookmark(feedSource, `inv_channel_videos_${id}`, bookmarkGroupNode)
feedSource = {
"apiType": "Invidious",
"endpoint": "channel_info",
"apiType": "Invidious"
"endpoint": "channel_info"
"pathParams": {
"ucid": id
}
@@ -34,10 +34,10 @@ class DashManifest
xml = new XmlObject()
if xml.Node("MPD", {
"xmlns": "urn:mpeg:dash:schema:mpd:2011",
"profiles": "urn:mpeg:dash:profile:full:2011",
"minBufferTime": "PT1.5S",
"type": "static",
"xmlns": "urn:mpeg:dash:schema:mpd:2011"
"profiles": "urn:mpeg:dash:profile:full:2011"
"minBufferTime": "PT1.5S"
"type": "static"
"mediaPresentationDuration": `PT${metadata.lengthSeconds ?? 0}S`
})
if xml.Node("Period")
@@ -45,9 +45,9 @@ class DashManifest
id = 0
for each audioSet in audioSets
adaptationSetAttributes = {
"id": `${id}`,
"mimeType": audioSet.mimeType,
"startWithSAP": "1",
"id": `${id}`
"mimeType": audioSet.mimeType
"startWithSAP": "1"
"subsegmentAlignment": "true"
}
if not StringUtils.IsNullOrEmpty(audioSet.lang)
@@ -56,7 +56,7 @@ class DashManifest
if xml.Node("AdaptationSet", adaptationSetAttributes)
xml.Node("Role", {
"schemeIdUri": "urn:mpeg:dash:role:2011",
"schemeIdUri": "urn:mpeg:dash:role:2011"
"value": audioSet.acont = "original" ? "main" : "alternate"
})
xml.End()
@@ -77,13 +77,13 @@ class DashManifest
end if
if xml.Node("Representation", {
"id": stream.itag,
"codecs": codecs,
"id": stream.itag
"codecs": codecs
"bandwidth": stream.bitrate
})
xml.Node("AudioChannelConfiguration", {
"schemeIdUri": "urn:mpeg:dash:23003:3:audio_channel_configuration:2011",
"schemeIdUri": "urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
"value": `${stream.audioChannels}`
})
xml.End()
@@ -115,9 +115,9 @@ class DashManifest
for each mimeType in videoMimeTypes
if xml.Node("AdaptationSet", {
"id": `${id}`,
"mimeType": mimeType,
"startWithSAP": "1",
"id": `${id}`
"mimeType": mimeType
"startWithSAP": "1"
"subsegmentAlignment": "true"
})
@@ -137,10 +137,10 @@ class DashManifest
end if
representationAttributes = {
"id": stream.itag,
"codecs": codecs,
"startWithSAP": "1",
"maxPlayoutRate": "1",
"id": stream.itag
"codecs": codecs
"startWithSAP": "1"
"maxPlayoutRate": "1"
"bandwidth": stream.bitrate
}
if stream.width <> invalid
@@ -226,26 +226,26 @@ class DashManifest
bandwidth = ((storyboardWidthInPixels * storyboardHeightInPixels * 0.5) / duration)
if xml.Node("AdaptationSet", {
"id": `${id}`,
"mimeType": "image/jpeg",
"id": `${id}`
"mimeType": "image/jpeg"
"contentType": "image"
})
xml.Node("SegmentTemplate", {
"media": url,
"duration": duration,
"media": url
"duration": duration
"startNumber": 0
})
xml.End()
if xml.Node("Representation", {
"id": `thumbnails_${id}`,
"bandwidth": bandwidth,
"width": storyboardWidthInPixels,
"id": `thumbnails_${id}`
"bandwidth": bandwidth
"width": storyboardWidthInPixels
"height": storyboardHeightInPixels
})
xml.Node("EssentialProperty", {
"schemeIdUri": "http://dashif.org/guidelines/thumbnail_tile",
"schemeIdUri": "http://dashif.org/guidelines/thumbnail_tile"
"value": `${storyboardWidth}x${storyboardHeight}`
})
xml.End()
@@ -334,8 +334,8 @@ class DashManifest
stream = streams[i]
mimeType = stream.type.Tokenize(";")[0]
types[`${mimeType}-${stream.languageInfo.lang}-${stream.languageInfo.acont}`] = {
"mimeType": mimeType,
"lang": stream.languageInfo.lang,
"mimeType": mimeType
"lang": stream.languageInfo.lang
"acont": stream.languageInfo.acont
}
end for
@@ -45,15 +45,15 @@ namespace Invidious
m.endpoints = node.apiDefinitions
m.responseHanlders = {
DefaultHandler: m.DefaultHandler,
AuthFeedHandler: m.AuthFeedHandler,
PlaylistHandler: m.PlaylistHandler,
VideoInfoHandler: m.VideoInfoHandler,
PlaylistInfoHandler: m.PlaylistInfoHandler,
ChannelInfoHandler: m.ChannelInfoHandler,
ChannelVideosHandler: m.ChannelVideosHandler,
ChannelPlaylistsHandler: m.ChannelPlaylistsHandler,
ChannelRelatedChannelsHandler: m.ChannelRelatedChannelsHandler,
DefaultHandler: m.DefaultHandler
AuthFeedHandler: m.AuthFeedHandler
PlaylistHandler: m.PlaylistHandler
VideoInfoHandler: m.VideoInfoHandler
PlaylistInfoHandler: m.PlaylistInfoHandler
ChannelInfoHandler: m.ChannelInfoHandler
ChannelVideosHandler: m.ChannelVideosHandler
ChannelPlaylistsHandler: m.ChannelPlaylistsHandler
ChannelRelatedChannelsHandler: m.ChannelRelatedChannelsHandler
WatchHistoryHandler: m.WatchHistoryHandler
}
end function
@@ -209,7 +209,7 @@ namespace Invidious
endpoint = m.endpoints[feedSource.endpoint]
if endpoint = invalid
return {
success: false,
success: false
error: `Endpoint ${feedSource.endpoint} not found`
}
end if
@@ -222,7 +222,7 @@ namespace Invidious
authToken = m.node.authToken
if authToken = invalid
return {
success: false,
success: false
error: ERROR_NOT_AUTHENTICATED
}
end if
@@ -283,12 +283,12 @@ namespace Invidious
if response.IsSuccess() and result <> invalid
return {
success: true,
success: true
result: result
}
else
return {
success: false,
success: false
error: response.ErrorMessage()
}
end if
@@ -318,7 +318,7 @@ namespace Invidious
if response.StatusCode() = 200
json = response.Json()
return {
items: json.videos,
items: json.videos
continuation: json.continuation
}
end if
@@ -329,7 +329,7 @@ namespace Invidious
if response.StatusCode() = 200
json = response.Json()
return {
items: json.playlists,
items: json.playlists
continuation: json.continuation
}
end if
@@ -340,7 +340,7 @@ namespace Invidious
if response.StatusCode() = 200
json = response.Json()
return {
items: json.relatedChannels,
items: json.relatedChannels
continuation: json.continuation
}
end if
@@ -422,7 +422,7 @@ namespace Invidious
videos = []
for each item in json
videos.push({
"type": "video",
"type": "video"
"videoId": item
})
end for
@@ -454,7 +454,7 @@ namespace Invidious
' Right now we're probably in a UI thread, and we can't unregister the token
' Without a Task
StartAsyncTask(InvidiousUnregisterTokenTask, {
invidious: m.node,
invidious: m.node
authToken: authToken
})
RegistryUtils.Delete(RegistryUtils.INVIDIOUS_TOKEN)
@@ -470,8 +470,8 @@ We apologize for the inconvenience.`
function SetAuthToken(token as string, instance as string, username as dynamic)
obj = {
token: token,
instance: instance,
token: token
instance: instance
username: username
}
@@ -20,7 +20,7 @@ function InvidiousSubscriptionsTask(input as object) as object
LogError("Error getting subscriptions:", error)
return {
success: false,
success: false
error: response.ErrorMessage()
}
end if
@@ -6,7 +6,6 @@ namespace SponsorBlock
const SKIP_SEGMENT_ENDPOINT = "/api/skipSegments"
const VIEWED_SEGMENT_ENDPOINT = "/api/viewedVideoSponsorTime"
class SponsorBlockService
function new()
' TODO:P2 this is being read and parsed on every skipped segment. It should be cached.
@@ -15,8 +15,8 @@ function SponsorBlockTask(input as object) as object
end if
return {
videoId: videoId,
skipSegments: skipSegments,
videoId: videoId
skipSegments: skipSegments
barPath: barPath
}
end function
@@ -4,18 +4,18 @@ function OnContentSet() as void
content = m.top.itemContent
visibleProperties = {
"video": "videoRowCellVisible",
"playlist": "playlistRowCellVisible",
"channel": "channelRowCellVisible",
"loading": "loadingRowCellVisible",
"video": "videoRowCellVisible"
"playlist": "playlistRowCellVisible"
"channel": "channelRowCellVisible"
"loading": "loadingRowCellVisible"
"action": "actionRowCellVisible"
}
contentProperties = {
"video": "videoRowCellItemContent",
"playlist": "playlistRowCellItemContent",
"channel": "channelRowCellItemContent",
"loading": "loadingRowCellItemContent",
"video": "videoRowCellItemContent"
"playlist": "playlistRowCellItemContent"
"channel": "channelRowCellItemContent"
"loading": "loadingRowCellItemContent"
"action": "actionRowCellItemContent"
}
@@ -209,7 +209,7 @@ function InitContent() as void
end if
task = StartAsyncTask(VideoRowListContentTask, {
node: m.top,
node: m.top
feeds: m.top.feeds
}, OnVideoRowListContentTaskResult)
m.pendingLoadTasks[task.id] = task
@@ -282,8 +282,8 @@ function LoadRowContent(contentNode as object)
contentNode.loadState = FeedLoadState.Loading
task = StartAsyncTask(VideoRowListRowContentTask, {
rowList: m.top,
feedContentNode: contentNode,
rowList: m.top
feedContentNode: contentNode
invidious: m.invidious
}, OnVideoRowListRowContentTaskResult)
m.pendingLoadTasks[task.id] = task
@@ -143,7 +143,7 @@ function VideoRowListRowContentTask(input as object) as object
catch error
HandleFeedLoadErrorDialog(error, rowList)
return {
success: false,
success: false
error: error
}
end try
@@ -110,7 +110,7 @@ namespace SponsorBlock
barPath = output.result.barPath
if barPath <> invalid
m.top.trickPlayBar.trackImageUri = barPath
m.top.trickPlayBar.filledBarBlendColor = "0xFF000080"
m.top.trickPlayBar.filledBarBlendColor = "#FF000080"
end if
m.top.UnobserveFieldScoped("position")
@@ -27,7 +27,7 @@ function VideoContentTask(input as object) as object
if not response.IsSuccess() or metadata = invalid
return {
success: false,
success: false
error: response.ErrorMessage()
}
end if
@@ -41,9 +41,9 @@ function VideoContentTask(input as object) as object
SetCaptions(metadata, service, contentNode)
contentNode.addFields({
metadata: metadata,
metadata: metadata
' StreamUrls is taken
playletStreamUrls: streamUrls,
playletStreamUrls: streamUrls
playletStreamUrlIndex: 0
})
@@ -104,11 +104,11 @@ function AddStreamUrls(streamUrls as object, metadata as object, service as Invi
' These are roughly the itags for 360p and 480p
' Most videos will hit 18, which is 360p
mediumItags = {
"18": true,
"43": true,
"44": true,
"82": true,
"83": true,
"18": true
"43": true
"44": true
"82": true
"83": true
"101": true
}
for each formatStream in metadata.formatStreams
@@ -172,8 +172,8 @@ function SetCaptions(metadata as object, service as object, contentNode as objec
for each caption in metadata.captions
subtitleTracks.Push({
Description: caption.label,
Language: isoLanguageList[caption.language_code] ?? caption.language_code,
Description: caption.label
Language: isoLanguageList[caption.language_code] ?? caption.language_code
TrackName: instance + caption.url
})
end for
@@ -69,9 +69,9 @@ function StartVideoContentTask(videoContentNode as object)
m.top.content = videoContentNode
m.videoContentTask = StartAsyncTask(VideoContentTask, {
content: videoContentNode,
invidious: m.top.invidious,
preferences: m.top.preferences,
content: videoContentNode
invidious: m.top.invidious
preferences: m.top.preferences
playletServerPort: m.top.webServer.port
}, OnVideoContentTaskResults)
end function
@@ -110,7 +110,7 @@ end function
function MarkVideoWatched(videoId as string)
if m.top.invidious.authToken <> invalid
StartAsyncTask(MarkVideoWatchedTask, {
videoId: videoId,
videoId: videoId
invidious: m.top.invidious
})
end if
@@ -1,12 +1,12 @@
function SetPlayerStyle()
m.top.trickPlayBar.filledBarBlendColor = "0xFF1C30FF"
m.top.bufferingBar.filledBarBlendColor = "0xFF1C30FF"
m.top.retrievingBar.filledBarBlendColor = "0xFF1C30FF"
m.top.trickPlayBar.filledBarBlendColor = "#FF1C30FF"
m.top.bufferingBar.filledBarBlendColor = "#FF1C30FF"
m.top.retrievingBar.filledBarBlendColor = "#FF1C30FF"
' Find the BusySpinner built into the Video node
busySpinner = FindChildNodeOfType(m.top, "BusySpinner")
if busySpinner <> invalid
busySpinner.poster.blendColor = "0xFF1C30FF"
busySpinner.poster.blendColor = "#FF1C30FF"
end if
end function
@@ -52,7 +52,7 @@ namespace Http
end for
feeds.push({
"title": bookmarkGroupNode.title,
"title": bookmarkGroupNode.title
"feedSources": feedSources
})
end for
@@ -18,7 +18,7 @@ namespace Http
end if
response.Json({
loaded: scene.playletLibLoadedUrl,
loaded: scene.playletLibLoadedUrl
saved: saved
})
return true
@@ -50,11 +50,10 @@ namespace Http
if ArrayUtils.IndexOfString(keys, "invidious") <> -1
authToken = invidiousNode.authToken
state["invidious"] = {
current_instance: invidiousNode@.GetCurrentInstance(),
' backup_instances: InvidiousSettings.GetBackupInstances(),
auth_url: invidiousNode@.GetAuthorizeTokenLink(),
logged_in: authToken <> invalid,
logged_in_instance: authToken <> invalid ? authToken.instance : invalid,
current_instance: invidiousNode@.GetCurrentInstance()
auth_url: invidiousNode@.GetAuthorizeTokenLink()
logged_in: authToken <> invalid
logged_in_instance: authToken <> invalid ? authToken.instance : invalid
logged_in_username: authToken <> invalid ? authToken.username : invalid
}
end if
@@ -36,10 +36,10 @@ namespace Http
for each route in m.routes
if m.RouteMatchesRequest(route, request)
if route.handler({
router: m,
request: request,
response: response,
connection: connection,
router: m
request: request
response: response
connection: connection
server: response.server
}) = true
return true
@@ -25,7 +25,7 @@ namespace Http
if not StringUtils.IsNullOrEmpty(path)
m.pathToEtags[path] = {
etag: response.headers["ETag"],
etag: response.headers["ETag"]
size: body.count()
}
end if
@@ -41,7 +41,7 @@ namespace Web
LogInfo("on connect")
for each listener in m.onConnectListeners
listener({
server: m,
server: m
connection: connection
})
end for
@@ -51,7 +51,7 @@ namespace Web
LogInfo("on disconnect")
for each listener in m.onDisconnectListeners
listener({
server: m,
server: m
connection: connection
})
end for
@@ -60,8 +60,8 @@ namespace Web
function TriggerOnMessage(connection as Web.WebSocketConnection, message as string)
for each listener in m.onMessageListeners
listener({
server: m,
connection: connection,
server: m
connection: connection
message: message
})
end for