jf-roku/DEVGUIDE.md

169 lines
4.7 KiB
Markdown
Raw Normal View History

## Developing The Jellyfin Roku App
Follow the steps below to install the app on your personal Roku device for development.
### Developer Mode
Put your Roku device in [developer mode](https://blog.roku.com/developer/2016/02/04/developer-setup-guide). Write down your Roku device IP and the password you created, you will need these later.
### Clone the GitHub Repo
Navigate to where you'd like to install the app then copy the application files:
```bash
git clone https://github.com/jellyfin/jellyfin-roku.git
```
Open up the new folder:
```bash
cd jellyfin-roku
```
### Install Necessary Packages
```bash
2020-11-30 08:53:05 +00:00
sudo apt-get install wget make zip
```
2020-11-30 08:53:05 +00:00
## Method 1: Sideload to Roku Device Manually
```bash
make dev
```
This will create a zip in `out/apps/Jellyfin_Roku-dev.zip`. Login to your roku's device in your browser and upload the zip file then run install.
## Method 2: Direct load to Roku Device
### Login Details
Run this command - replacing the IP and password with your Roku device IP and dev password from the first step:
```bash
export ROKU_DEV_TARGET=192.168.1.234
export ROKU_DEV_PASSWORD=password
```
Normally you would have to open up your browser and upload a .zip file containing the app code. These commands enable the app to be zipped up and installed on the Roku automatically which is essential for developers and makes it easy to upgrade in the future for users.
### Deploy
Package up the application, send it to your Roku, and launch the channel:
```bash
make install
```
Note: You only have to run this command once if you are not a developer. The Jellyfin channel will still be installed after rebooting your Roku device.
2022-05-23 12:31:58 +00:00
## Method 3: Visual Studio Code
See the [Visual Studio Code setup section](#developer-setup-visual-studio-code) below.
2020-11-30 08:53:05 +00:00
## Bug/Crash Reports
Did the app crash? Find a nasty bug? Use the this command to view the error log and [report it to the developers](https://github.com/jellyfin/jellyfin-roku/issues):
```bash
telnet ${ROKU_DEV_TARGET} 8085
```
To exit telnet: `CTRL + ]` and then type `quit + ENTER`
2020-11-30 08:53:05 +00:00
## Upgrade
Navigate to the folder where you installed the app then upgrade the code to the latest version:
```bash
git pull
```
Deploy the app:
```bash
make install
```
2022-05-23 12:42:13 +00:00
## Developer Setup (Visual Studio Code)
2022-05-23 12:42:13 +00:00
Users of Visual Studio Code will find a community developed extension for BrightScript that makes installing and testing Jellyfin builds straightforward.
The extension can be found [HERE](https://marketplace.visualstudio.com/items?itemName=RokuCommunity.brightscript) and more information on
setting up developer enviornments can be found on [Roku's website](https://developer.roku.com/docs/developer-program/getting-started/developer-setup.md)
### Hardcoding Roku Information
Out of the box, the VSCode extension will prompt you to pick a Roku from your device and enter a password on every launch. If you'd prefer to hardcode this information rather than entering it every time, you can set these values in your vscode user settings:
```js
{
"brightscript.debug.host": "YOUR_ROKU_HOST_HERE",
"brightscript.debug.password": "YOUR_ROKU_DEV_PASSWORD_HERE",
}
```
Example:
![image](https://user-images.githubusercontent.com/2544493/170485209-0dbe6787-8026-47e7-9095-1df96cda8a0a.png)
2022-05-23 12:42:13 +00:00
### Command Line Workflow
Modify code -> `make install` -> Use Roku remote to test changes -> `telnet ${ROKU_DEV_TARGET} 8085` -> `CTRL + ]` -> `quit + ENTER`
Unfortunately there is no debuger. You will need to use telnet to see log statements, warnings, and error reports. You won't always need to telnet into your device but the workflow above is typical when you are new to Brightscript or are working on tricky code.
### Testing
Testing is done with the [Rooibos](https://github.com/georgejecook/rooibos/) library. This works by including tests in the deployment and then looking at telnet
for the test results.
Install necessary packages:
```bash
sudo apt-get install nodejs npm
```
Install [rooibos-cli](https://github.com/georgejecook/rooibos-cli):
```bash
npm install -g rooibos-cli
```
Deploy the application with tests:
```bash
make test
```
View test results:
```bash
telnet ${ROKU_DEV_TARGET} 8085
```
To exit telnet: `CTRL + ]` and then type `quit + ENTER`
2022-04-29 07:03:01 +00:00
### Committing
Before commiting your code, please run:
```bash
make prep_commit
```
This will format your code and run the CI checks locally to ensure you will pass the CI tests.
### (Optional) Update Images
This repo already contains all necessary images for the app. This script only needs to be run when the [official Jellyfin images](https://github.com/jellyfin/jellyfin-ux) are changed to allow us to update the repo images.
Install necessary packages:
```bash
sudo apt-get install imagemagick
```
Download and convert images:
```bash
make get_images
```