Multiple profiles (#312)

* Navbar user profile

* profiles stuff

* fix profile

* Lint fix

* Some ui experiments

* More ui work

* progress

* Lint fix

* migration, web api, wip

* profile view and web app

* web app and apis

* Invidious and profiles

* Lint fix

* bug fix

* Remove ActionContentNode

* Profile icon button, profile color

* Lint fix

* reset server url

* href that doesn't work

* remove activate button on active profile

* TODO

* Fin.

* Final touches

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
This commit is contained in:
Brahim Hadricheandgithub-action linter authored and GitHub committed 2024-03-04 09:04:34 -05:00
1 parent 8e03ca0ea6
commit 394dd23999
60 files changed
+1725 -311

No files matched your search

@@ -1,13 +0,0 @@
function Init()
m.label = m.top.findNode("label")
end function
function OnContentSet() as void
content = m.top.itemContent
if content = invalid
return
end if
m.label.text = content.title
end function
@@ -1,17 +0,0 @@
<component name="ActionRowCell" extends="Group">
<interface>
<field id="itemContent" type="node" onChange="OnContentSet" />
<field id="type" type="string" value="action" />
</interface>
<children>
<Label
id="label"
width="310"
height="196"
horizAlign="center"
vertAlign="center"
translation="[20,0]"
wrap="true"
font="font:LargeBoldSystemFont" />
</children>
</component>
@@ -8,7 +8,6 @@ function OnContentSet() as void
"playlist": "playlistRowCellVisible"
"channel": "channelRowCellVisible"
"loading": "loadingRowCellVisible"
"action": "actionRowCellVisible"
}
contentProperties = {
@@ -16,7 +15,6 @@ function OnContentSet() as void
"playlist": "playlistRowCellItemContent"
"channel": "channelRowCellItemContent"
"loading": "loadingRowCellItemContent"
"action": "actionRowCellItemContent"
}
if content = invalid
@@ -8,13 +8,11 @@
<field id="playlistRowCellVisible" type="boolean" alias="PlaylistRowCell.visible" />
<field id="channelRowCellVisible" type="boolean" alias="ChannelRowCell.visible" />
<field id="loadingRowCellVisible" type="boolean" alias="LoadingRowCell.visible" />
<field id="actionRowCellVisible" type="boolean" alias="ActionRowCell.visible" />
<field id="videoRowCellItemContent" type="node" alias="VideoRowCell.itemContent" />
<field id="playlistRowCellItemContent" type="node" alias="PlaylistRowCell.itemContent" />
<field id="channelRowCellItemContent" type="node" alias="ChannelRowCell.itemContent" />
<field id="loadingRowCellItemContent" type="node" alias="LoadingRowCell.itemContent" />
<field id="actionRowCellItemContent" type="node" alias="ActionRowCell.itemContent" />
<field id="loadingRowCellIndex" type="integer" alias="LoadingRowCell.index" />
</interface>
@@ -23,6 +21,5 @@
<PlaylistRowCell id="PlaylistRowCell" />
<ChannelRowCell id="ChannelRowCell" />
<LoadingRowCell id="LoadingRowCell" />
<ActionRowCell id="ActionRowCell" />
</children>
</component>
@@ -108,12 +108,8 @@ function OnRowItemSelected(index as object) as void
authorId = rowItem.authorId
LogInfo("Open channel: " + authorId)
OpenChannel(rowItem)
else if rowItem.type = "action"
if rowItem.action = "LoginDialog"
dialog = CreateObject("roSGNode", "LoginDialog")
dialog@.BindNode()
m.top.getScene().dialog = dialog
end if
else
LogWarn("Unknown row item type:", rowItem.type)
end if
end function
@@ -2,6 +2,7 @@ import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Services/Invidious/InvidiousService.bs"
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
' TODO:P1 handle case where all feedSources are empty
@asynctask
function VideoRowListRowContentTask(input as object) as object
try
@@ -59,17 +60,13 @@ function VideoRowListRowContentTask(input as object) as object
if not response.success
if response.error = Invidious.ERROR_NOT_AUTHENTICATED
RemovePlaceHolderItems(feedContentNode)
actionNode = CreateObject("roSGNode", "ActionContentNode")
actionNode.title = `Login to view ${feedSource.title}`
actionNode.action = "LoginDialog"
feedSource.state.loadState = FeedLoadState.Loaded
feedSources[feedSourcesIndex] = feedSource
feedContentNode.feedSources = feedSources
feedContentNode.appendChild(actionNode)
feedContentNode.loadState = FeedLoadState.Loaded
if feedSources.Count() = 1
parent = feedContentNode.getParent()
parent.removeChild(feedContentNode)
return {
success: true
}
end if
continue while
end if