Skip to content

Commit

Permalink
Merge pull request #828 from neilsb/1.6-Release (Unstable -> Master)
Browse files Browse the repository at this point in the history
  • Loading branch information
neilsb authored Oct 28, 2022
2 parents ceabea2 + 313f631 commit fed3950
Show file tree
Hide file tree
Showing 115 changed files with 12,388 additions and 1,391 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/auto-close-stale-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Close stale Pull Requests"
on:
schedule:
- cron: "30 1 * * *"

jobs:
stale:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/stale@3de2653986ebd134983c79fe2be5d45cc3d9f4e1 # tag=v6
with:
days-before-issue-stale: -1
days-before-issue-close: -1
stale-pr-message: "This pull request has been inactive for 21 days and will be automatically closed in 7 days if there is no further activity."
close-pr-message: "This pull request has been closed because it has been inactive for 28 days. You may submit a new pull request if desired."
days-before-pr-stale: 21
days-before-pr-close: 7
repo-token: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: build
on:
pull_request:
push:
paths-ignore:
- 'locale/**'
jobs:
run:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
with:
node-version: "14.12.0"
- run: npm ci
- run: npx ropm install
- run: make dev
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
with:
name: Jellyfin-Roku-dev-${{ github.sha }}
path: ${{ github.workspace }}/out/staging
if-no-files-found: error
9 changes: 5 additions & 4 deletions .github/workflows/master-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
with:
node-version: "14.12.0"
- run: npm ci
- run: npx ropm install
- run: npm run validate
- run: npm run check-formatting
- name: "Find and save major_version from manifest"
Expand All @@ -21,8 +22,8 @@ jobs:
run: awk 'BEGIN { FS="=" } /^minor_version/ { print "MINOR="$2; }' manifest >> $GITHUB_ENV
- name: "Find and save build_version from manifest"
run: awk 'BEGIN { FS="=" } /^build_version/ { print "BUILD="$2; }' manifest >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: vimtor/action-zip@v1
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: vimtor/action-zip@5f1c4aa587ea41db1110df6a99981dbe19cee310 # tag=v1
with:
recursive: false
files: components/ images/ locale/ settings/ source/ manifest
Expand All @@ -35,8 +36,8 @@ jobs:
prerelease: false
title: v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.BUILD }}
files: ${{ github.workspace }}/jellyfin_v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.BUILD }}.zip
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
with:
name: jellyfin_v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.BUILD }}.zip
path: ${{ github.workspace }}/jellyfin_v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.BUILD }}.zip
if-no-files-found: error
if-no-files-found: error
9 changes: 5 additions & 4 deletions .github/workflows/unstable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
with:
node-version: "14.12.0"
- run: npm ci
- run: npx ropm install
- run: npm run validate
- run: npm run check-formatting
- name: "Find and save major_version from manifest"
Expand All @@ -21,8 +22,8 @@ jobs:
run: awk 'BEGIN { FS="=" } /^minor_version/ { print "MINOR="$2; }' manifest >> $GITHUB_ENV
- name: "Find and save build_version from manifest"
run: awk 'BEGIN { FS="=" } /^build_version/ { print "BUILD="$2; }' manifest >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: vimtor/action-zip@v1
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: vimtor/action-zip@5f1c4aa587ea41db1110df6a99981dbe19cee310 # tag=v1
with:
recursive: false
files: components/ images/ locale/ settings/ source/ manifest
Expand All @@ -34,8 +35,8 @@ jobs:
prerelease: true
title: v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.BUILD }}
files: ${{ github.workspace }}/jellyfin_v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.BUILD }}.zip
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
with:
name: jellyfin_v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.BUILD }}.zip
path: ${{ github.workspace }}/jellyfin_v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.BUILD }}.zip
if-no-files-found: error
if-no-files-found: error
1 change: 1 addition & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ jobs:
with:
node-version: "14.12.0"
- run: npm ci
- run: npx ropm install
- run: npm run validate
- run: npm run check-formatting
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ source/globals.brs
dist/apps
out/

roku_modules

#NPM modules
node_modules/

Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"files.associations": {
"*.ts": "xml"
}
},
"editor.formatOnSave": true
}
7 changes: 7 additions & 0 deletions DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ Open up the new folder:
cd jellyfin-roku
```

Install Dependencies:

```bash
npm install
```



## Method 1: Visual Studio Code
We recommend using Visual Studio Code when working on this project. The [BrightScript Language extension](https://marketplace.visualstudio.com/items?itemName=RokuCommunity.brightscript) provides a rich debugging experience, including in-editor syntax checking, debugging/breakpoint support, variable inspection at runtime, auto-formatting, an integrated remote control mode, and [much more](https://rokucommunity.github.io/vscode-brightscript-language/features.html).
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
##########################################################################

APPNAME = Jellyfin_Roku
VERSION = 1.4.12
VERSION = 1.6.0
ROKU_TEST_ID = 1
ROKU_TEST_WAIT_DURATION = 5

Expand Down
5 changes: 4 additions & 1 deletion bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
"locale/**/*.*",
"settings/*.*"
],
"plugins": [ "@rokucommunity/bslint" ]
"plugins": [ "@rokucommunity/bslint" ],
"diagnosticFilters": [
"**/roku_modules/**/*"
]
}
81 changes: 81 additions & 0 deletions components/IconButton.brs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
sub init()
m.buttonBackground = m.top.findNode("buttonBackground")
m.buttonIcon = m.top.findNode("buttonIcon")
m.buttonText = m.top.findNode("buttonText")

m.top.observeField("background", "onBackgroundChanged")
m.top.observeField("icon", "onIconChanged")
m.top.observeField("text", "onTextChanged")
m.top.observeField("height", "onHeightChanged")
m.top.observeField("width", "onWidthChanged")
m.top.observeField("padding", "onPaddingChanged")
m.top.observeField("focus", "onFocusChanged")
end sub

sub onFocusChanged()
if m.top.focus
m.buttonBackground.blendColor = m.top.focusBackground
else
m.buttonBackground.blendColor = m.top.background
end if
end sub

sub onBackgroundChanged()
m.buttonBackground.blendColor = m.top.background
m.top.unobserveField("background")
end sub

sub onIconChanged()
m.buttonIcon.uri = m.top.icon
end sub

sub onTextChanged()
m.buttonText.text = m.top.text
end sub

sub setIconSize()
height = m.buttonBackground.height
width = m.buttonBackground.width
if height > 0 and width > 0
' TODO: Use smallest number between them
m.buttonIcon.height = m.top.height

if m.top.padding > 0
m.buttonIcon.height = m.buttonIcon.height - m.top.padding
end if

m.buttonIcon.width = m.buttonIcon.height

m.buttonIcon.translation = [((width - m.buttonIcon.width) / 2), ((height - m.buttonIcon.height) / 2)]
m.buttonText.translation = [0, height + 10]
m.buttonText.width = width
end if
end sub

sub onHeightChanged()
m.buttonBackground.height = m.top.height
setIconSize()
end sub

sub onWidthChanged()
m.buttonBackground.width = m.top.width
setIconSize()
end sub

sub onPaddingChanged()
setIconSize()
end sub

function onKeyEvent(key as string, press as boolean) as boolean
if not press then return false

if key = "right" and m.top.focus
m.top.escape = "right"
end if

if key = "left" and m.top.focus
m.top.escape = "left"
end if

return false
end function
21 changes: 21 additions & 0 deletions components/IconButton.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="IconButton" extends="Group">
<children>
<Poster id="buttonBackground" uri="pkg:/images/white.9.png" />
<Poster id="buttonIcon" />
<Label id="buttonText" color="#aaaaaa" font="font:SmallestSystemFont" horizAlign="center" />
</children>
<interface>
<field id="background" type="color" value="" />
<field id="focusBackground" type="color" value="" />
<field id="text" type="string" value="" />
<field id="padding" type="integer" value="-1" />
<field id="height" type="integer" value="" />
<field id="width" type="integer" value="" />
<field id="icon" type="string" value="" />
<field id="selected" type="boolean" value="false" />
<field id="focus" type="boolean" />
<field id="escape" type="string" value="" />
</interface>
<script type="text/brightscript" uri="IconButton.brs" />
</component>
14 changes: 14 additions & 0 deletions components/ItemGrid/GridItem.brs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@ sub itemContentChanged()
m.backdrop.height = 290
m.backdrop.width = 290

m.posterText.height = 200
m.posterText.width = 280
else if itemData.json.type = "MusicAlbum"
m.itemPoster.uri = itemData.PosterUrl
m.itemText.text = itemData.Title

m.itemPoster.height = 290
m.itemPoster.width = 290

m.itemText.translation = [0, m.itemPoster.height + 7]

m.backdrop.height = 290
m.backdrop.width = 290

m.posterText.height = 200
m.posterText.width = 280
else
Expand Down
Loading

0 comments on commit fed3950

Please sign in to comment.