Skip to content

Commit

Permalink
Merge pull request #887 from 1hitsong/V1.6.2
Browse files Browse the repository at this point in the history
Pull V1.6.2 into master
  • Loading branch information
1hitsong authored Dec 12, 2022
2 parents 22bebc8 + 28eabb8 commit de9088f
Show file tree
Hide file tree
Showing 64 changed files with 6,077 additions and 10,719 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/auto-close-stale-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: actions/stale@3de2653986ebd134983c79fe2be5d45cc3d9f4e1 # tag=v6
- uses: actions/stale@5ebf00ea0e4c1561e9b43a292ed34424fb1d4578 # 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
exempt-draft-pr: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ jobs:
run:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3
- uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # 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
- uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # tag=v3
with:
name: Jellyfin-Roku-dev-${{ github.sha }}
path: ${{ github.workspace }}/out/staging
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/master-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ 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@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3
- uses: vimtor/action-zip@5f1c4aa587ea41db1110df6a99981dbe19cee310 # tag=v1
with:
recursive: false
Expand All @@ -36,7 +36,7 @@ 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@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
- uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # 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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unstable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ 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@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3
- uses: vimtor/action-zip@5f1c4aa587ea41db1110df6a99981dbe19cee310 # tag=v1
with:
recursive: false
Expand All @@ -35,7 +35,7 @@ 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@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
- uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # 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
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ roku_modules
#NPM modules
node_modules/

#Rooibos generated
rooibosFunctionMap.brs
*/buildinfo.brs
logs

#Eclipse
.buildpath
.project
Expand Down
25 changes: 0 additions & 25 deletions DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,37 +130,12 @@ Modify code -> `make install` -> Use Roku remote to test changes -> `telnet ${RO

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`

### Committing

Before commiting your code, please run:
Expand Down
11 changes: 2 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

#########################################################################
# Makefile Usage:
# > make test ' run all tests
# > make testFailures ' run all tests and show only failures
#
# 1) Make sure that you have the curl command line executable in your path
# 2) Set the variable ROKU_DEV_TARGET in your environment to the IP
Expand All @@ -12,11 +10,9 @@
##########################################################################

APPNAME = Jellyfin_Roku
VERSION = 1.6.1
ROKU_TEST_ID = 1
ROKU_TEST_WAIT_DURATION = 5
VERSION = 1.6.2

ZIP_EXCLUDE= -x rooibos/**\* -x xml/* -x artwork/* -x \*.pkg -x storeassets\* -x keys\* -x \*/.\* -x *.git* -x *.DS* -x *.pkg* -x dist/**\* -x out/**\*
ZIP_EXCLUDE= -x xml/* -x artwork/* -x \*.pkg -x storeassets\* -x keys\* -x \*/.\* -x *.git* -x *.DS* -x *.pkg* -x dist/**\* -x out/**\*

include app.mk

Expand All @@ -29,7 +25,4 @@ beta:
release:
$(MAKE) BUILD='release' package

test: prep_staging prep_tests remove install
echo "Running tests"

deploy: prep_staging remove install
7 changes: 0 additions & 7 deletions app.mk
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,6 @@ package: prep_staging

@echo "*** packaging $(APPNAME)-$(BUILD) complete ***"

prep_tests:
@mkdir -p $(STAGINGREL)/components/tests/; \
mkdir -p $(STAGINGREL)/source/tests/; \
cp -r $(SOURCEREL)/tests/components/* $(STAGINGREL)/components/tests/;\
cp -r $(SOURCEREL)/tests/source/* $(STAGINGREL)/source/tests/;\
./node_modules/.bin/rooibos-cli i tests/.rooibosrc.json

prep_commit:
npm run format
npm ci
Expand Down
13 changes: 13 additions & 0 deletions components/GetNextEpisodeTask.brs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sub init()
m.top.functionName = "getNextEpisodeTask"
end sub

sub getNextEpisodeTask()
m.nextEpisodeData = api_API().shows.getepisodes(m.top.showID, {
UserId: get_setting("active_user"),
StartItemId: m.top.videoID,
Limit: 2
})

m.top.nextEpisodeData = m.nextEpisodeData
end sub
12 changes: 12 additions & 0 deletions components/GetNextEpisodeTask.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>

<component name="GetNextEpisodeTask" extends="Task">
<interface>
<field id="videoID" type="string" />
<field id="showID" type="string" />
<field id="nextEpisodeData" type="assocarray" />
</interface>
<script type="text/brightscript" uri="GetNextEpisodeTask.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/api/api.brs" />
</component>
42 changes: 42 additions & 0 deletions components/ItemGrid/GridItemSmall.brs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
sub init()
m.itemPoster = m.top.findNode("itemPoster")
m.posterText = m.top.findNode("posterText")
m.posterText.font.size = 30
m.backdrop = m.top.findNode("backdrop")

m.itemPoster.observeField("loadStatus", "onPosterLoadStatusChanged")

'Parent is MarkupGrid and it's parent is the ItemGrid
m.topParent = m.top.GetParent().GetParent()

'Get the imageDisplayMode for these grid items
if m.topParent.imageDisplayMode <> invalid
m.itemPoster.loadDisplayMode = m.topParent.imageDisplayMode
end if

end sub

sub itemContentChanged()
m.backdrop.blendColor = "#101010"

itemData = m.top.itemContent

if not isValid(itemData) then return

m.itemPoster.uri = itemData.PosterUrl
m.posterText.text = itemData.title

'If Poster not loaded, ensure "blue box" is shown until loaded
if m.itemPoster.loadStatus <> "ready"
m.backdrop.visible = true
m.posterText.visible = true
end if
end sub

'Hide backdrop and text when poster loaded
sub onPosterLoadStatusChanged()
if m.itemPoster.loadStatus = "ready"
m.backdrop.visible = false
m.posterText.visible = false
end if
end sub
16 changes: 16 additions & 0 deletions components/ItemGrid/GridItemSmall.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="GridItemSmall" extends="Group">
<children>
<Poster id="backdrop" translation="[0,15]" width="230" height="320" loadDisplayMode="scaleToZoom" uri="pkg:/images/white.9.png" />
<Poster id="itemPoster" translation="[0,15]" width="230" height="320" loadDisplayMode="scaleToZoom" />
<Poster id="itemIcon" width="50" height="50" translation="[230,10]" />
<Label id="posterText" width="230" height="320" translation="[5,5]" horizAlign="center" vertAlign="center" ellipsizeOnBoundary="true" wrap="true" />
</children>
<interface>
<field id="itemContent" type="node" onChange="itemContentChanged" />
<field id="itemHasFocus" type="boolean" onChange="focusChanged" />
</interface>
<script type="text/brightscript" uri="GridItemSmall.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>
37 changes: 21 additions & 16 deletions components/ItemGrid/ItemGrid.brs
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,14 @@ end sub

' Set Photo Album view, sort, and filter options
sub setPhotoAlbumOptions(options)
' TODO/FIXME: Show shuffle options once implemented
' options.views = [
' { "Title": tr("Don't Shuffle"), "Name": "singlephoto"}
' { "Title": tr("Shuffle"), "Name": "shufflephoto"}
' ]
options.views = []
options.views = [
{ "Title": tr("Slideshow Off"), "Name": "singlephoto" }
{ "Title": tr("Slideshow On"), "Name": "slideshowphoto" }
{ "Title": tr("Random Off"), "Name": "singlephoto" }
{ "Title": tr("Random On"), "Name": "randomphoto" }
]
options.sort = []
options.filter = []
end sub

' Set Default view, sort, and filter options
Expand Down Expand Up @@ -574,14 +575,17 @@ sub optionsClosed()
end if
end if

if m.top.parentItem.Type = "CollectionFolder" or m.top.parentItem.CollectionType = "CollectionFolder"
' Did the user just request "Shuffle" on a PhotoAlbum?
if m.top.parentItem.Type = "CollectionFolder" or m.top.parentItem.Type = "Folder" or m.top.parentItem.CollectionType = "CollectionFolder"
' Did the user just request "Random" on a PhotoAlbum?
if m.options.view = "singlephoto"
' TODO/FIXME: Stop shuffling here
print "TODO/FIXME: Stop any shuffling here"
else if m.options.view = "shufflephoto"
' TODO/FIXME: Start shuffling here
print "TODO/FIXME: Start shuffle here"
set_user_setting("photos.slideshow", "false")
set_user_setting("photos.random", "false")
else if m.options.view = "slideshowphoto"
set_user_setting("photos.slideshow", "true")
set_user_setting("photos.random", "false")
else if m.options.view = "randomphoto"
set_user_setting("photos.random", "true")
set_user_setting("photos.slideshow", "false")
end if
end if

Expand Down Expand Up @@ -724,9 +728,10 @@ function onKeyEvent(key as string, press as boolean) as boolean
return true
else if itemToPlay <> invalid and itemToPlay.type = "Photo"
' Spawn photo player task
photoPlayer = CreateObject("roSgNode", "PhotoPlayerTask")
photoPlayer.itemContent = itemToPlay
photoPlayer.control = "RUN"
photoPlayer = CreateObject("roSgNode", "PhotoDetails")
photoPlayer.items = markupGrid
photoPlayer.itemIndex = markupGrid.itemFocused
m.global.sceneManager.callfunc("pushScene", photoPlayer)
return true
end if
else if key = "left" and topGrp.isinFocusChain()
Expand Down
Loading

0 comments on commit de9088f

Please sign in to comment.