Skip to content

Commit

Permalink
Set TODO priorities
Browse files Browse the repository at this point in the history
  • Loading branch information
iBicha committed Aug 27, 2023
1 parent f3a6dec commit ab3f9b7
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 28 deletions.
5 changes: 2 additions & 3 deletions playlet-lib/src/components/Navigation/ScrollTo.bs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
' TODO: refactor this into a ScrollView component
' TODO: use this in settings and search screans
' TODO:P2 refactor this into a ScrollView component
' TODO:P2 use this in settings and search screans
function ScrollTo(viewPort as object, containerToMove as object, focusNode as object, animation as object, interpolator as object) as void
if viewPort = invalid or containerToMove = invalid or focusNode = invalid
return
Expand Down Expand Up @@ -39,5 +39,4 @@ function ScrollTo(viewPort as object, containerToMove as object, focusNode as ob
interpolator.keyValue = [animStart, animMid, animEnd]

animation.control = "start"
' containerToMove.translation = [translateX + translation[0], translateY + translation[1]]
end function
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function HomeScreenRowContentTask(input as object) as boolean
service = new Invidious.InvidiousService(invidiousNode)
response = service.MakeRequest(contentNode.feed)

' TODO: handle cancellation
' TODO: handle unauthenticated requests
' TODO:P0 handle cancellation
' TODO:P0 handle unauthenticated requests
if response = invalid
contentNode.loadState = "failed"
contentNode.title += " (Failed to load)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function OnSearchTaskResults(output as object) as void
return
end if

' TODO: Handle errors
' TODO:P0 Handle errors
if not output.success
m.log.error(output.error)
HideLoadingScreen()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@asynctask
function GenerateQrCodeTask(input as object)
' TODO: QR Code generation is happening on UI thread and is hanging for a second
' TODO:P1 QR Code generation is happening on UI thread and is hanging for a second
' Needs to be properly decoupled from Node logic
qrPoster = input.qrPoster
text = input.text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace Invidious
request.Cancellation(cancellation)

response = request.Await()
' TODO: return error if status code is not 200
' TODO:P0 return error if status code is not 200
return response.Json()
end function

Expand Down Expand Up @@ -157,7 +157,7 @@ namespace Invidious
request.PathParams(requestData.pathParams)
end if

' TODO: error handling
' TODO:P0 error handling
response = request.Await()

responseHandler = endpoint.responseHandler <> invalid ? m.responseHanlders[endpoint.responseHandler] : m.responseHanlders["DefaultHandler"]
Expand Down Expand Up @@ -274,7 +274,7 @@ namespace Invidious

expire = TimeUtils.Now().AsSeconds() + Invidious.TOKEN_TIMESPAN

'TODO: scope and expire in the callback
'TODO:P0 scope and expire in the callback
callbackUrl = `${address}${Invidious.TOKEN_CALLBACK}?ref=${instance}`.EncodeUriComponent()
scope = `${Invidious.AUTH_SCOPES}`.EncodeUriComponent()
return `${invidiousHost}/authorize_token?scopes=${scope}&callback_url=${callbackUrl}&expire=${expire}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function MigrateExistingPreferences(userPrefs as object) as boolean
' 'do stuff
' end if

' TODO: handle case where saved preferences version is higher than current version (e.g. user downgraded)
' TODO:PX handle case where saved preferences version is higher than current version (e.g. user downgraded)
return isDirty
end function

Expand Down Expand Up @@ -154,7 +154,7 @@ function ApplyUserPreferences(preferences as object) as void
if preferences = invalid
return
end if
' TODO: user input validation
' TODO:P2 user input validation
m.disableSavingToRegistry = true
m.top.setFields(preferences)
m.disableSavingToRegistry = false
Expand Down
6 changes: 3 additions & 3 deletions playlet-lib/src/components/VideoPlayer/VideoPlayer.bs
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@ end function

function OnVideoContentTaskResults(output as object) as void
if not output.success
' TODO: show error - unhandled error
' TODO:P0 show error - unhandled error
return
end if

if not output.result.success
' TODO: show error - request error
' TODO:P0 show error - request error
return
end if

m.top.control = "play"
if ValidInt(m.top.content.timestamp) > 0
' TODO: handle seeking in the case where the first stream url failed
' TODO:P0 handle seeking in the case where the first stream url failed
m.top.seek = m.top.content.timestamp
end if
end function
Expand Down
2 changes: 1 addition & 1 deletion playlet-lib/src/components/VideoRowCell/VideoRowCell.bs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function IsVideoLive(metadata as object) as boolean
if metadata.liveNow = true
return true
end if
' TODO: metadata.liveNow is returning false for live videos...
' TODO:P2 metadata.liveNow is returning false for live videos...
return metadata.lengthSeconds = 0 and metadata.viewCount = 0
end function

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "pkg:/components/Services/Invidious/InvidiousLogoutTask.bs"

function InvidiousLogout(unusued as dynamic)
invidiousNode = m.top.invidious
' TODO: this needs a task because it starts a request and we're currently on render thread
' TODO:P1 this needs a task because it starts a request and we're currently on render thread
' We need a request library that does not block
StartAsyncTask(InvidiousLogoutTask, { node: invidiousNode })
end function
Expand All @@ -23,7 +23,6 @@ function PlayVideo(args as object) as void
timestamp = timestamp.toInt()
end if

' TODO: fix focus when video played from rpc
VideoUtils.PlayVideo({
videoId: videoId,
timestamp: timestamp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ namespace Http
end if
end function

' TODO: this function does not take into account multiple ranges.
' TODO:P2 this function does not take into account multiple ranges.
function ParseRange()
range = m.headers.range
if range <> invalid
Expand Down
4 changes: 2 additions & 2 deletions playlet-lib/src/components/Web/WebServer/Http/HttpResponse.bs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ namespace Http
code = m.http_code
title = WebUtils.HttpTitle(code)

m.headers["Date"] = m.Now() 'TODO
m.headers["Date"] = m.Now() 'TODO:P0
m.headers["Server"] = m.settings.serverName

if not m.headers.DoesExist("Connection")
Expand Down Expand Up @@ -182,7 +182,7 @@ namespace Http
end function

function KeepAlive(keepAlive as boolean)
' TODO: there's bug with keep alive where connections hang in some cases
' TODO:P0 there's bug with keep alive where connections hang in some cases
' Forcing close connections for now until I can investigate why
keepAlive = false
if keepAlive
Expand Down
4 changes: 2 additions & 2 deletions playlet-lib/src/components/Web/WebServer/Http/HttpServer.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "HttpConnection.bs"

namespace Http

'TODO: these need a better home
'TODO:P0 these need a better home
function InitGlobals()
WebUtils.MimeType()
WebUtils.HttpTitle()
Expand Down Expand Up @@ -39,7 +39,7 @@ namespace Http
m.Init()
end function

' TODO: this needs error handling for when the server fails to start
' TODO:P0 this needs error handling for when the server fails to start
function Init()
m.uptime = CreateObject("roTimespan")
m.connections = CreateObject("roAssociativeArray")
Expand Down
12 changes: 10 additions & 2 deletions playlet-web/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
import { onMount } from "svelte";
import NavBar from "./lib/NavBar.svelte";
import { PlayletApi } from "./lib/PlayletApi";
import { appStateStore, homeLayoutFileStore, invidiousVideoApiStore, playletStateStore, preferencesModelStore, searchHistoryStore, userPreferencesStore } from "./lib/Stores";
import {
appStateStore,
homeLayoutFileStore,
invidiousVideoApiStore,
playletStateStore,
preferencesModelStore,
searchHistoryStore,
userPreferencesStore,
} from "./lib/Stores";
import BottomNavigation from "./lib/BottomNavigation.svelte";
import ScreenHome from "./lib/ScreenHome.svelte";
import type { AppState } from "./lib/Types";
Expand Down Expand Up @@ -52,7 +60,7 @@
<LinkDragDrop />

<NavBar />
<!-- TODO: a better way to make the BottomNavigation not hide screens -->
<!-- TODO:P2 a better way to make the BottomNavigation not hide screens -->
<div style="margin-bottom: 4rem">
<ScreenSearch visibility={currentScreen == "search"} />

Expand Down
2 changes: 1 addition & 1 deletion playlet-web/src/lib/VideoCell.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
</div>
</div>
</button>
<!-- TODO: a dialog for every video is very slow. Need to reuse the same one -->
<!-- TODO:P2 a dialog for every video is very slow. Need to reuse the same one -->
<dialog bind:this={modal} id="modal_{videoId}" class="modal">
<form method="dialog" class="modal-box bg-base-100">
<h3 class="text-lg m-5">{title}</h3>
Expand Down
2 changes: 1 addition & 1 deletion playlet-web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const config: UserConfig = {
}
}

// TODO: refactor this with the same code in tools/get-env-vars.js
// TODO:P2 refactor this with the same code in tools/get-env-vars.js
function getEnvVars() {
const envFile = joinPath(__dirname, '../.env');

Expand Down
2 changes: 1 addition & 1 deletion tools/bs-plugins/oninit-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class OnInitPlugin implements CompilerPlugin {
const initFunction = this.getInitCallableInScope(scope);
if (!initFunction) {
onInitCallables.forEach((onInitCallable) => {
// TODO: we currently add diagnostics to the xml file, but we should add them to the brs file
// TODO:P2 we currently add diagnostics to the xml file, but we should add them to the brs file
// The reasons is, when we add to a generated file (like Component_bindings.brs), the errors
// Are stuck, and won't be fixed until the file is changed, which we can't do since it's not a real file.
scope.xmlFile.addDiagnostics([{
Expand Down

0 comments on commit ab3f9b7

Please sign in to comment.