Bookmarks (#153)

* Empty bookmarks screen

* Bookmarks object

* Long press support

* Lint fix

* Context menu v1

* A working context menu

* Basic bookmarks in context menu

* Use a root content node for bookmarks

* context menu animation

* small tweak

* move logger around, adjust animation

* Lint fix

* Restore logger fix

* Cache channel info

* Bookmarks v1

* Added comment

* Adjust "popular" feed error handling

* Progress with bookmarks

* Add todo

* add todo

* handle roDateTime logging

* logger adjustment

* Use yaml for api and layout

* rename requestData to feedSource

* Restructure things

* Lint fix

* remove comment

* introduce feedSource id

* small cleanup

* playlist context menu

* Context menu for the channel view

* changelog

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
This commit is contained in:
Brahim Hadricheandgithub-action linter authored and GitHub committed 2023-10-19 19:16:27 -04:00
1 parent 620a8a6e2b
commit c740d5e0a0
63 files changed
+1889 -510

No files matched your search

@@ -8,6 +8,7 @@ import "pkg:/source/utils/LoadingScreen.bs"
import "pkg:/source/utils/Logging.bs"
function Init()
m.top.focusable = true
m.container = m.top.FindNode("container")
m.keyboard = m.top.FindNode("keyboard")
m.rowList = m.top.FindNode("rowList")
@@ -16,6 +17,8 @@ function Init()
m.suggestions = m.top.FindNode("suggestions")
m.filtersButton = m.top.FindNode("filtersButton")
m.rowList.screen = m.top
textEditBox = m.keyboard.textEditBox
textEditBox.voiceEntryType = "generic"
textEditBox.voiceEnabled = true
@@ -200,7 +203,8 @@ function Search(text as string)
m.rowlist.ObserveFieldScoped("someContentReady", FuncName(OnSearchContentReady))
ShowLoadingScreen()
requestData = {
feedSource = {
id: `inv_search_${CryptoUtils.GetMd5(text)}`,
title: `Search - ${text}`,
apiType: "Invidious",
endpoint: "search",
@@ -213,18 +217,21 @@ function Search(text as string)
for each filter in filters
value = filters[filter]
if IsString(value) and value.len() > 0
requestData.queryParams[filter] = value
feedSource.queryParams[filter] = value
else if IsArray(value) and value.Count() > 0
' TODO:P1 this is http client implementation details leaking
' We need a declarative way to set array types
requestData.queryParams[filter] = {
feedSource.queryParams[filter] = {
value: value,
__arrayType: HttpClient.QueryParamArrayType.CommaSeparated
}
end if
end for
m.rowList.contentData = [requestData]
m.rowList.feeds = [{
title: `Search - ${text}`,
feedSources: [feedSource]
}]
end function
function OnSearchContentReady() as void
@@ -243,7 +250,7 @@ function OnSearchContentReady() as void
end function
function OnSearchError()
m.rowlist.contentData = invalid
m.rowlist.feeds = invalid
m.rowlist.focusable = false
HideLoadingScreen()
end function
@@ -258,7 +265,7 @@ end function
function ClearSearch()
m.keyboard.text = ""
m.rowlist.contentData = invalid
m.rowlist.feeds = invalid
m.rowlist.focusable = false
ScrollUp()
end function
@@ -40,8 +40,8 @@
rowItemSpacing="[[25,0]]"
itemSize="[1280,326]"
itemSpacing="[0,65]"
rowLabelOffset="[[115,20]]"
focusXOffset="[115]"
rowLabelOffset="[[125,20]]"
focusXOffset="[125]"
showRowLabel="[true]"
rowFocusAnimationStyle="floatingfocus"
variableWidthItems="true"