-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove code from Main.brs - create App class to handle init, login flow, and main loop #1319
Conversation
…es roku-log (m.log) for everything in the class
…nts for all events in main loop
This pull request has merge conflicts. Please resolve the conflicts so the PR can be reviewed. Thanks! |
Let me know if you need help testing any of this. |
…lyfin-roku into remove-code-from-main
This pull request has merge conflicts. Please resolve the conflicts so the PR can be reviewed. Thanks! |
1 similar comment
This pull request has merge conflicts. Please resolve the conflicts so the PR can be reviewed. Thanks! |
This pull request has merge conflicts. Please resolve the conflicts so the PR can be reviewed. Thanks! |
Restructure
Main.brs
to use the least amount of code as possible because nothing inMain.brs
can be unit tested and also becauseroku-log
won't work inMain.brs
. I did keep some of the global stuff inMain.brs
because it needs to be run as early as possible and also because there's only so much we can do while the "splashscreen" is up.To do this I created a new class called
App.bs
which is used to initialize the app, handle the login flow, and the main loop(with m.port). roku-log is saved to thelog
var and can be accessed withm.log
when running code inside the class (when inside a classm
refers to the class members and methods).I've also updated the
LoginFlow()
function to use roku-log. To do this I imported the roku-log file at the top ofShowScenes.brs
and setup a logger inside the function. This isn't ideal since every function would have to setup a logger but was needed because of all the debug statements insideLoginFlow()
.Changes
bsconfig.json
- don't remove roku-log statements for dev builds (I thought these were false by default but apparently not. This is why I wasn't able to get this working originally)JFScreen.brs
toJFScene.brs
Main.brs
as possibleApp
class to handle init, login flow, and main app looproku-log
inside theApp
classNOTE: I did NOT convert the print statement that spits out the array of user settings because when roku-log prints associative arrays they are very ugly. using print looks much better 😄
Issues
Fixes #1245
Still working on a few things so marking this as draft for now