diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index 26e185141..c01410d06 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -3,16 +3,13 @@ name: build-dev on: pull_request: push: - branches: - - master - - "*.*.z" jobs: dev: runs-on: ubuntu-latest steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4 with: node-version: "lts/*" cache: "npm" @@ -22,7 +19,7 @@ jobs: run: npm run ropm - name: Build app run: npm run build - - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4 + - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4 with: name: Jellyfin-Roku-dev-${{ github.sha }} path: ${{ github.workspace }}/build/staging diff --git a/.github/workflows/build-prod.yml b/.github/workflows/build-prod.yml index bc9c676b9..c140c0758 100644 --- a/.github/workflows/build-prod.yml +++ b/.github/workflows/build-prod.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4 with: node-version: "lts/*" cache: "npm" @@ -23,7 +23,7 @@ jobs: run: npm run ropm - name: Build app for production run: npm run build-prod - - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4 + - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4 with: name: Jellyfin-Roku-v${{ env.newManVersion }}-${{ github.sha }} path: ${{ github.workspace }}/build/staging diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml new file mode 100644 index 000000000..a241a8488 --- /dev/null +++ b/.github/workflows/bump-version.yml @@ -0,0 +1,235 @@ +name: "Create PR to bump version" + +on: + workflow_dispatch: + inputs: + targetBranch: + description: 'Target Branch' + required: true + type: choice + options: + - bugfix + - master + versionType: + description: 'What Version to Bump' + required: true + type: choice + options: + - build + - minor + - major + +jobs: + build: + if: ${{ github.event.inputs.versionType == 'build' }} + runs-on: ubuntu-latest + steps: + # Setup + - name: Checkout code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - name: Install required packages + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: jq + - name: Save targetBranch to env + if: github.event.inputs.targetBranch != 'bugfix' + run: echo "targetBranch=${{ github.event.inputs.targetBranch }}" >> $GITHUB_ENV + # Save old version + - name: Find and save old major_version from manifest + run: awk 'BEGIN { FS="=" } /^major_version/ { print "oldMajor="$2; }' manifest >> $GITHUB_ENV + - name: Find and save old minor_version from manifest + run: awk 'BEGIN { FS="=" } /^minor_version/ { print "oldMinor="$2; }' manifest >> $GITHUB_ENV + - name: Find and save old build_version from manifest + run: awk 'BEGIN { FS="=" } /^build_version/ { print "oldBuild="$2; }' manifest >> $GITHUB_ENV + # Bugfix branch + - name: Save bugfix branch name + if: github.event.inputs.targetBranch == 'bugfix' + run: echo "bugfixBranch=${{ env.oldMajor }}.${{ env.oldMinor }}.z" >> $GITHUB_ENV + - name: Update targetBranch with actual bugfix branch name + if: github.event.inputs.targetBranch == 'bugfix' + run: echo "targetBranch=${{ env.bugfixBranch }}" >> $GITHUB_ENV + - name: Checkout bugfix branch + if: github.event.inputs.targetBranch == 'bugfix' + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + with: + ref: ${{ env.targetBranch }} + # Save old version again if needed + - name: Find and save old major_version from manifest + if: github.event.inputs.targetBranch == 'bugfix' + run: awk 'BEGIN { FS="=" } /^major_version/ { print "oldMajor="$2; }' manifest >> $GITHUB_ENV + - name: Find and save old minor_version from manifest + if: github.event.inputs.targetBranch == 'bugfix' + run: awk 'BEGIN { FS="=" } /^minor_version/ { print "oldMinor="$2; }' manifest >> $GITHUB_ENV + - name: Find and save old build_version from manifest + if: github.event.inputs.targetBranch == 'bugfix' + run: awk 'BEGIN { FS="=" } /^build_version/ { print "oldBuild="$2; }' manifest >> $GITHUB_ENV + # Calculate new version + - name: Calculate new build_version + run: echo "newBuild=$((${{ env.oldBuild }} + 1))" >> $GITHUB_ENV + - name: Save new version to env var + run: echo "newVersion=${{ env.oldMajor }}.${{ env.oldMinor }}.${{ env.newBuild }}" >> $GITHUB_ENV + - name: Save a copy of newVersion without periods to env var + run: echo "newVersionSlug=${{ env.newVersion }}" | sed -e 's/\.//g' >> $GITHUB_ENV + # Update files with new versions + - name: Update manifest build_version + run: sed -i "s/build_version=.*/build_version=${{ env.newBuild }}/g" manifest + - name: Update package-lock.json version + run: echo "$( jq '.version = "'"${{ env.newVersion }}"'"' package-lock.json )" > package-lock.json + - name: Update package-lock.json version 2 + run: echo "$( jq '.packages."".version = "'"${{ env.newVersion }}"'"' package-lock.json )" > package-lock.json + - name: Update package.json version + run: echo "$( jq '.version = "'"${{ env.newVersion }}"'"' package.json )" > package.json + - name: Update Makefile version + run: sed -i "s/VERSION := .*/VERSION := ${{ env.newVersion }}/g" Makefile + # Create PR + - name: Save new branch name to env + run: echo "newBranch=bump-${{ github.event.inputs.targetBranch }}-to-${{ env.newVersionSlug }}" >> $GITHUB_ENV + - name: Create PR with new version + env: + GH_TOKEN: ${{ secrets.JF_BOT_TOKEN }} + run: |- + git config user.name "jellyfin-bot" + git config user.email "team@jellyfin.org" + git checkout -b "${{ env.newBranch }}" + git add . + git commit -m "Bump ${{ github.event.inputs.versionType }} version" + git push --set-upstream origin "${{ env.newBranch }}" + gh pr create --title "Bump ${{ github.event.inputs.targetBranch }} branch to ${{ env.newVersion }}" --body "Bump version to prep for next release." --label ignore-changelog --base ${{ env.targetBranch }} + minor: + if: ${{ github.event.inputs.versionType == 'minor' }} + runs-on: ubuntu-latest + steps: + # Setup + - name: Checkout code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - name: Install jq to update json + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: jq + - name: Save targetBranch to env + if: github.event.inputs.targetBranch != 'bugfix' + run: echo "targetBranch=${{ github.event.inputs.targetBranch }}" >> $GITHUB_ENV + # Save old version + - name: Find and save old major_version from manifest + run: awk 'BEGIN { FS="=" } /^major_version/ { print "oldMajor="$2; }' manifest >> $GITHUB_ENV + - name: Find and save old minor_version from manifest + run: awk 'BEGIN { FS="=" } /^minor_version/ { print "oldMinor="$2; }' manifest >> $GITHUB_ENV + - name: Find and save old build_version from manifest + run: awk 'BEGIN { FS="=" } /^build_version/ { print "oldBuild="$2; }' manifest >> $GITHUB_ENV + # Bugfix branch + - name: Save bugfix branch name + if: github.event.inputs.targetBranch == 'bugfix' + run: echo "bugfixBranch=${{ env.oldMajor }}.${{ env.oldMinor }}.z" >> $GITHUB_ENV + - name: Update targetBranch with actual bugfix branch name + if: github.event.inputs.targetBranch == 'bugfix' + run: echo "targetBranch=${{ env.bugfixBranch }}" >> $GITHUB_ENV + - name: Checkout bugfix branch + if: github.event.inputs.targetBranch == 'bugfix' + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + with: + ref: ${{ env.targetBranch }} + # Calculate new version + - name: Calculate new build_version + run: echo "newMinor=$((${{ env.oldMinor }} + 1))" >> $GITHUB_ENV + - name: Save new version to env var + run: echo "newVersion=${{ env.oldMajor }}.${{ env.newMinor }}.0" >> $GITHUB_ENV + - name: Save a copy of newVersion without periods to env var + run: echo "newVersionSlug=${{ env.newVersion }}" | sed -e 's/\.//g' >> $GITHUB_ENV + # Update files with new versions + - name: Update manifest minor_version + run: sed -i "s/minor_version=.*/minor_version=${{ env.newMinor }}/g" manifest + - name: Update manifest build_version + run: sed -i "s/build_version=.*/build_version=0/g" manifest + - name: Update package-lock.json version + run: echo "$( jq '.version = "'"${{ env.newVersion }}"'"' package-lock.json )" > package-lock.json + - name: Update package-lock.json version 2 + run: echo "$( jq '.packages."".version = "'"${{ env.newVersion }}"'"' package-lock.json )" > package-lock.json + - name: Update package.json version + run: echo "$( jq '.version = "'"${{ env.newVersion }}"'"' package.json )" > package.json + - name: Update Makefile version + run: sed -i "s/VERSION := .*/VERSION := ${{ env.newVersion }}/g" Makefile + # Create PR + - name: Save new branch name to env + run: echo "newBranch=bump-${{ github.event.inputs.targetBranch }}-to-${{ env.newVersionSlug }}" >> $GITHUB_ENV + - name: Create PR with new version + env: + GH_TOKEN: ${{ secrets.JF_BOT_TOKEN }} + run: |- + git config user.name "jellyfin-bot" + git config user.email "team@jellyfin.org" + git checkout -b "${{ env.newBranch }}" + git add . + git commit -m "Bump ${{ github.event.inputs.versionType }} version" + git push --set-upstream origin "${{ env.newBranch }}" + gh pr create --title "Bump ${{ github.event.inputs.targetBranch }} branch to ${{ env.newVersion }}" --body "Bump version to prep for next release." --label ignore-changelog --base ${{ env.targetBranch }} + + major: + if: ${{ github.event.inputs.versionType == 'major' }} + runs-on: ubuntu-latest + steps: + # Setup + - name: Checkout code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - name: Install jq to update json + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: jq + - name: Save targetBranch to env + if: github.event.inputs.targetBranch != 'bugfix' + run: echo "targetBranch=${{ github.event.inputs.targetBranch }}" >> $GITHUB_ENV + # Save old version + - name: Find and save old major_version from manifest + run: awk 'BEGIN { FS="=" } /^major_version/ { print "oldMajor="$2; }' manifest >> $GITHUB_ENV + - name: Find and save old minor_version from manifest + run: awk 'BEGIN { FS="=" } /^minor_version/ { print "oldMinor="$2; }' manifest >> $GITHUB_ENV + - name: Find and save old build_version from manifest + run: awk 'BEGIN { FS="=" } /^build_version/ { print "oldBuild="$2; }' manifest >> $GITHUB_ENV + # Bugfix branch + - name: Save bugfix branch name + if: github.event.inputs.targetBranch == 'bugfix' + run: echo "bugfixBranch=${{ env.oldMajor }}.${{ env.oldMinor }}.z" >> $GITHUB_ENV + - name: Update targetBranch with actual bugfix branch name + if: github.event.inputs.targetBranch == 'bugfix' + run: echo "targetBranch=${{ env.bugfixBranch }}" >> $GITHUB_ENV + - name: Checkout bugfix branch + if: github.event.inputs.targetBranch == 'bugfix' + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + with: + ref: ${{ env.targetBranch }} + # Calculate new version + - name: Calculate new build_version + run: echo "newMajor=$((${{ env.oldMajor }} + 1))" >> $GITHUB_ENV + - name: Save new version to env var + run: echo "newVersion=${{ env.newMajor }}.0.0" >> $GITHUB_ENV + - name: Save a copy of newVersion without periods to env var + run: echo "newVersionSlug=${{ env.newVersion }}" | sed -e 's/\.//g' >> $GITHUB_ENV + # Update files with new versions + - name: Update manifest major_version + run: sed -i "s/major_version=.*/major_version=${{ env.newMajor }}/g" manifest + - name: Update manifest minor_version + run: sed -i "s/minor_version=.*/minor_version=0/g" manifest + - name: Update manifest build_version + run: sed -i "s/build_version=.*/build_version=0/g" manifest + - name: Update package-lock.json version + run: echo "$( jq '.version = "'"${{ env.newVersion }}"'"' package-lock.json )" > package-lock.json + - name: Update package-lock.json version 2 + run: echo "$( jq '.packages."".version = "'"${{ env.newVersion }}"'"' package-lock.json )" > package-lock.json + - name: Update package.json version + run: echo "$( jq '.version = "'"${{ env.newVersion }}"'"' package.json )" > package.json + - name: Update Makefile version + run: sed -i "s/VERSION := .*/VERSION := ${{ env.newVersion }}/g" Makefile + # Create PR + - name: Save new branch name to env + run: echo "newBranch=bump-${{ github.event.inputs.targetBranch }}-to-${{ env.newVersionSlug }}" >> $GITHUB_ENV + - name: Create PR with new version + env: + GH_TOKEN: ${{ secrets.JF_BOT_TOKEN }} + run: |- + git config user.name "jellyfin-bot" + git config user.email "team@jellyfin.org" + git checkout -b "${{ env.newBranch }}" + git add . + git commit -m "Bump ${{ github.event.inputs.versionType }} version" + git push --set-upstream origin "${{ env.newBranch }}" + gh pr create --title "Bump ${{ github.event.inputs.targetBranch }} branch to ${{ env.newVersion }}" --body "Bump version to prep for next release." --label ignore-changelog --base ${{ env.targetBranch }} + \ No newline at end of file diff --git a/.github/workflows/deploy-api-docs.yml b/.github/workflows/deploy-api-docs.yml index 3f33d6cc8..a7c57963e 100644 --- a/.github/workflows/deploy-api-docs.yml +++ b/.github/workflows/deploy-api-docs.yml @@ -32,12 +32,12 @@ jobs: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - name: Setup Pages - uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4 + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 - name: Upload artifact - uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 # v3 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 with: # Only upload the api docs folder path: "docs/api" - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@87c3283f01cd6fe19a0ab93a23b2f6fcba5a8e42 # v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1eebdf85c..a46dfa9d8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -61,7 +61,7 @@ jobs: run: npm ci - name: Install roku package dependencies run: npx ropm install - - uses: xt0rted/markdownlint-problem-matcher@98d94724052d20ca2e06c091f202e4c66c3c59fb # v2 + - uses: xt0rted/markdownlint-problem-matcher@1a5fabfb577370cfdf5af944d418e4be3ea06f27 # v3 - name: Lint markdown files run: npm run lint-markdown spelling: diff --git a/.github/workflows/release-prep.yml b/.github/workflows/release-prep.yml index bcff37bec..0a5d8b083 100644 --- a/.github/workflows/release-prep.yml +++ b/.github/workflows/release-prep.yml @@ -63,7 +63,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4 with: node-version: "lts/*" cache: "npm" @@ -73,7 +73,7 @@ jobs: run: npm run ropm - name: Build app for production run: npm run build-prod - - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4 + - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4 with: name: Jellyfin-Roku-v${{ env.newManVersion }}-${{ github.sha }} path: ${{ github.workspace }}/build/staging diff --git a/.github/workflows/roku-analysis.yml b/.github/workflows/roku-analysis.yml index 92bb30e8c..456d3ff5d 100644 --- a/.github/workflows/roku-analysis.yml +++ b/.github/workflows/roku-analysis.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4 with: node-version: "lts/*" cache: "npm" @@ -27,7 +27,7 @@ jobs: if: env.BRANCH_NAME == 'master' run: npm run build-prod - name: Use Java 17 - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4 + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4 with: distribution: "temurin" java-version: "17" diff --git a/.vscode/launch.json b/.vscode/launch.json index fe6b11d6c..482f3d164 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,6 +12,7 @@ // set "brightscript.debug.raleTrackerTaskFileLocation": "/absolute/path/to/rale/TrackerTask.xml" in your vscode user settings // set the below field to true "injectRaleTrackerTask": false, + "injectRdbOnDeviceComponent": true, //WARNING: don't edit this value. Instead, set "brightscript.debug.host": "YOUR_HOST_HERE" in your vscode user settings //"host": "${promptForHost}", //WARNING: don't edit this value. Instead, set "brightscript.debug.password": "YOUR_PASSWORD_HERE" in your vscode user settings diff --git a/Makefile b/Makefile index 59ac987eb..d2dccb3c9 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # If you want to get_images, you'll also need convert from ImageMagick ########################################################################## -VERSION := 2.0.2 +VERSION := 2.0.5 ## usage @@ -76,6 +76,7 @@ remove: .PHONY: screenshot screenshot: + $(CURL_LOGGED_CMD) -F mysubmit=Screenshot "http://$(ROKU_DEV_TARGET)/plugin_inspect" $(CURL_LOGGED_CMD) -o screenshot.jpg "http://$(ROKU_DEV_TARGET)/pkgs/dev.jpg" .PHONY: deploy diff --git a/bsconfig-tdd-sample.json b/bsconfig-tdd-sample.json index ad0c7997d..d4bed6fa0 100644 --- a/bsconfig-tdd-sample.json +++ b/bsconfig-tdd-sample.json @@ -31,9 +31,9 @@ ], "diagnosticFilters": ["node_modules/**/*", "**/roku_modules/**/*"], "autoImportComponentScript": true, - "allowBrighterScriptInBrightScript": true, "createPackage": false, "stagingFolderPath": "build", + "retainStagingDir": true, "plugins": ["rooibos-roku"], "rooibos": { "isRecordingCodeCoverage": false, diff --git a/bsconfig-tests.json b/bsconfig-tests.json index b84a3f065..d7bca86a7 100644 --- a/bsconfig-tests.json +++ b/bsconfig-tests.json @@ -18,12 +18,13 @@ { "src": "settings/**/*", "dest": "settings" - } + }, + "manifest" ], "diagnosticFilters": ["node_modules/**/*", "**/roku_modules/**/*"], "autoImportComponentScript": true, - "allowBrighterScriptInBrightScript": true, "stagingFolderPath": "build", + "retainStagingDir": true, "plugins": ["rooibos-roku"], "rooibos": { "isRecordingCodeCoverage": false, diff --git a/components/ItemGrid/GridItem.bs b/components/ItemGrid/GridItem.bs index e20e27cc4..400a77e3f 100644 --- a/components/ItemGrid/GridItem.bs +++ b/components/ItemGrid/GridItem.bs @@ -38,10 +38,13 @@ sub init() end sub sub itemContentChanged() + m.backdrop.blendColor = "#00a4db" ' set default in case global var is invalid + localGlobal = m.global - ' Set Random background colors from pallet - posterBackgrounds = m.global.constants.poster_bg_pallet - m.backdrop.blendColor = posterBackgrounds[rnd(posterBackgrounds.count()) - 1] + if isValid(localGlobal) and isValid(localGlobal.constants) and isValid(localGlobal.constants.poster_bg_pallet) + posterBackgrounds = localGlobal.constants.poster_bg_pallet + m.backdrop.blendColor = posterBackgrounds[rnd(posterBackgrounds.count()) - 1] + end if itemData = m.top.itemContent @@ -56,14 +59,16 @@ sub itemContentChanged() m.itemIcon.uri = itemData.iconUrl m.itemText.text = itemData.Title else if itemData.type = "Series" - if m.global.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"] = false - if isValid(itemData.json) and isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount) - if itemData.json.UserData.UnplayedItemCount > 0 - m.unplayedCount.visible = true - m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount - else - m.unplayedCount.visible = false - m.unplayedEpisodeCount.text = "" + if isValid(localGlobal) and isValid(localGlobal.session) and isValid(localGlobal.session.user) and isValid(localGlobal.session.user.settings) + if localGlobal.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"] = false + if isValid(itemData.json) and isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount) + if itemData.json.UserData.UnplayedItemCount > 0 + m.unplayedCount.visible = true + m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount + else + m.unplayedCount.visible = false + m.unplayedEpisodeCount.text = "" + end if end if end if end if diff --git a/components/ItemGrid/LoadItemsTask2.bs b/components/ItemGrid/LoadItemsTask2.bs index f4688ff10..2a7292d90 100644 --- a/components/ItemGrid/LoadItemsTask2.bs +++ b/components/ItemGrid/LoadItemsTask2.bs @@ -136,6 +136,36 @@ sub loadItems() resp = APIRequest(url, params) data = getJson(resp) + + ' If user has filtered by #, include special characters sorted after Z as well + if isValid(params.NameLessThan) + if LCase(params.NameLessThan) = "a" + ' Use same params except for name filter param + params.NameLessThan = "" + params.NameStartsWithOrGreater = "z" + + ' Perform 2nd API lookup for items starting with Z or greater + startsWithZAndGreaterResp = APIRequest(url, params) + startsWithZAndGreaterData = getJson(startsWithZAndGreaterResp) + + if isValidAndNotEmpty(startsWithZAndGreaterData) + specialCharacterItems = [] + + ' Filter out items starting with Z + for each item in startsWithZAndGreaterData.Items + itemName = LCase(item.name) + if not itemName.StartsWith("z") + specialCharacterItems.Push(item) + end if + end for + + ' Append data to results from before A + data.Items.Append(specialCharacterItems) + data.TotalRecordCount += specialCharacterItems.Count() + end if + end if + end if + if data <> invalid if data.TotalRecordCount <> invalid then m.top.totalRecordCount = data.TotalRecordCount @@ -164,6 +194,8 @@ sub loadItems() tmp.image = PosterImage(item.id, { "maxHeight": 425, "maxWidth": 290, "quality": "90" }) else if item.type = "Episode" tmp = CreateObject("roSGNode", "TVEpisode") + else if LCase(item.Type) = "recording" + tmp = CreateObject("roSGNode", "RecordingData") else if item.Type = "Genre" tmp = CreateObject("roSGNode", "ContentNode") tmp.title = item.name diff --git a/components/ItemGrid/LoadVideoContentTask.bs b/components/ItemGrid/LoadVideoContentTask.bs index d8e212dd0..83cb4b0da 100644 --- a/components/ItemGrid/LoadVideoContentTask.bs +++ b/components/ItemGrid/LoadVideoContentTask.bs @@ -82,8 +82,8 @@ sub LoadItems_AddVideoContent(video as object, mediaSourceId as dynamic, audio_s videotype = LCase(meta.type) - ' Check for any Live TV streams coming from other places other than the TV Guide - if isValid(meta.json) and isValid(meta.json.ChannelId) + ' Check for any Live TV streams or Recordings coming from other places other than the TV Guide + if videotype = "recording" or (isValid(meta.json) and isValid(meta.json.ChannelId)) if isValid(meta.json.EpisodeTitle) meta.title = meta.json.EpisodeTitle else if isValid(meta.json.Name) @@ -97,13 +97,27 @@ sub LoadItems_AddVideoContent(video as object, mediaSourceId as dynamic, audio_s end if end if + video.chapters = meta.json.Chapters + video.content.title = meta.title + video.showID = meta.showID + + logoLookupID = video.id + if videotype = "episode" or videotype = "series" video.content.contenttype = "episode" + video.seasonNumber = meta.json.ParentIndexNumber + video.episodeNumber = meta.json.IndexNumber + video.episodeNumberEnd = meta.json.IndexNumberEnd + + if isValid(meta.showID) + logoLookupID = meta.showID + end if end if - video.chapters = meta.json.Chapters - video.content.title = meta.title - video.showID = meta.showID + logoImageExists = api.items.HeadImageURLByName(logoLookupID, "logo") + if logoImageExists + video.logoImage = api.items.GetImageURL(logoLookupID, "logo", 0, { "maxHeight": 65, "maxWidth": 300, "quality": "90" }) + end if user = AboutMe() if user.Configuration.EnableNextEpisodeAutoPlay @@ -249,7 +263,14 @@ function defaultSubtitleTrackFromVid(videoID) as integer if not isValidAndNotEmpty(meta.json.MediaSources[0].MediaStreams) then return SubtitleSelection.none subtitles = sortSubtitles(meta.id, meta.json.MediaSources[0].MediaStreams) - selectedAudioLanguage = meta.json.MediaSources[0].MediaStreams[m.top.selectedAudioStreamIndex].Language ?? "" + + selectedAudioLanguage = "" + audioMediaStream = meta.json.MediaSources[0].MediaStreams[m.top.selectedAudioStreamIndex] + + ' Ensure audio media stream is valid before using language property + if isValid(audioMediaStream) + selectedAudioLanguage = audioMediaStream.Language ?? "" + end if defaultTextSubs = defaultSubtitleTrack(subtitles["text"], selectedAudioLanguage, true) ' Find correct subtitle track (forced text) if defaultTextSubs <> SubtitleSelection.none diff --git a/components/JFOverhang.bs b/components/JFOverhang.bs index 360773e16..75f0f9f1b 100644 --- a/components/JFOverhang.bs +++ b/components/JFOverhang.bs @@ -2,9 +2,10 @@ import "pkg:/source/utils/config.bs" sub init() m.top.id = "overhang" - ' hide seperators till they're needed - m.leftSeperator = m.top.findNode("overlayLeftSeperator") - m.leftSeperator.visible = "false" + m.top.translation = [54, 0] + + m.leftGroup = m.top.findNode("overlayLeftGroup") + m.rightGroup = m.top.findNode("overlayRightGroup") m.rightSeperator = m.top.findNode("overlayRightSeperator") ' set font sizes m.optionText = m.top.findNode("overlayOptionsText") @@ -38,7 +39,7 @@ end sub sub onVisibleChange() if m.top.disableMoveAnimation - m.top.translation = [0, 0] + m.top.translation = [54, 0] return end if if m.top.isVisible @@ -50,16 +51,7 @@ sub onVisibleChange() end sub sub updateTitle() - if m.top.title <> "" - m.leftSeperator.visible = "true" - else - m.leftSeperator.visible = "false" - end if m.title.text = m.top.title - - if not m.hideClock - resetTime() - end if end sub sub setClockVisibility() @@ -84,7 +76,9 @@ end sub sub updateUser() setRightSeperatorVisibility() user = m.top.findNode("overlayCurrentUser") - user.text = m.top.currentUser + if isValid(user) + user.text = m.top.currentUser + end if end sub sub updateTime() @@ -145,3 +139,23 @@ sub updateOptions() m.optionStar.visible = false end if end sub + +' component boolean field isLogoVisibleChange has changed value +sub isLogoVisibleChange() + isLogoVisible = m.top.isLogoVisible + + scene = m.top.getScene() + logo = scene.findNode("overlayLogo") + + if isLogoVisible + if not isValid(logo) + posterLogo = createLogoPoster() + m.leftGroup.insertChild(posterLogo, 0) + end if + else + ' remove the logo + if isValid(logo) + m.leftGroup.removeChild(logo) + end if + end if +end sub diff --git a/components/JFOverhang.xml b/components/JFOverhang.xml index 224cd85e3..26f1eacc2 100644 --- a/components/JFOverhang.xml +++ b/components/JFOverhang.xml @@ -1,12 +1,11 @@ - \ No newline at end of file diff --git a/components/StandardDialog.bs b/components/StandardDialog.bs index 2b8e80b73..32447b497 100644 --- a/components/StandardDialog.bs +++ b/components/StandardDialog.bs @@ -22,6 +22,11 @@ sub init() "fontSize": 35, "fontUri": "font:SystemFontFile", "color": "#00a4dcFF" + }, + "p": { + "fontSize": 27, + "fontUri": "font:SystemFontFile", + "color": "#EFEFEFFF" } } diff --git a/components/config/LoginScene.bs b/components/config/LoginScene.bs index 80b6c75a2..f545b615d 100644 --- a/components/config/LoginScene.bs +++ b/components/config/LoginScene.bs @@ -1,8 +1,20 @@ +import "pkg:/source/utils/misc.bs" + sub init() m.top.setFocus(true) m.top.optionsAvailable = false end sub +' JFScreen hook. +sub OnScreenShown() + scene = m.top.getScene() + overhang = scene.findNode("overhang") + if isValid(overhang) + overhang.isLogoVisible = true + overhang.currentUser = "" + end if +end sub + function onKeyEvent(key as string, press as boolean) as boolean ' Returns true if user navigates to a new focusable element if not press then return false diff --git a/components/config/LoginScene.xml b/components/config/LoginScene.xml index 9c32da749..ef6d6b91c 100644 --- a/components/config/LoginScene.xml +++ b/components/config/LoginScene.xml @@ -1,5 +1,5 @@ - +