Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into cache-global
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert committed Oct 17, 2024
2 parents 95b84d0 + 4f867fe commit 79d671d
Show file tree
Hide file tree
Showing 48 changed files with 1,241 additions and 250 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version: "lts/*"
Expand All @@ -21,7 +21,7 @@ jobs:
run: npm run ropm
- name: Build app
run: npm run build
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: Jellyfin-Roku-dev-${{ github.sha }}
path: ${{ github.workspace }}/build/staging
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.JF_BOT_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'release-prep') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version: "lts/*"
Expand All @@ -23,7 +23,7 @@ jobs:
run: npm run ropm
- name: Build app for production
run: npm run build-prod
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: Jellyfin-Roku-v${{ env.newManVersion }}-${{ github.sha }}
path: ${{ github.workspace }}/build/staging
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
steps:
# Setup
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- name: Install required packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand All @@ -50,7 +50,7 @@ jobs:
run: echo "targetBranch=${{ env.bugfixBranch }}" >> $GITHUB_ENV
- name: Checkout bugfix branch
if: github.event.inputs.targetBranch == 'bugfix'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
with:
ref: ${{ env.targetBranch }}
# Save old version again if needed
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
steps:
# Setup
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- name: Install jq to update json
uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand All @@ -125,7 +125,7 @@ jobs:
run: echo "targetBranch=${{ env.bugfixBranch }}" >> $GITHUB_ENV
- name: Checkout bugfix branch
if: github.event.inputs.targetBranch == 'bugfix'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
with:
ref: ${{ env.targetBranch }}
# Calculate new version
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
steps:
# Setup
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- name: Install jq to update json
uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand All @@ -193,7 +193,7 @@ jobs:
run: echo "targetBranch=${{ env.bugfixBranch }}" >> $GITHUB_ENV
- name: Checkout bugfix branch
if: github.event.inputs.targetBranch == 'bugfix'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
with:
ref: ${{ env.targetBranch }}
# Calculate new version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
- name: Upload artifact
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/roku-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: github.repository == 'jellyfin/jellyfin-roku' && github.event_name != 'pull_request' || github.repository == 'jellyfin/jellyfin-roku' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version: "lts/*"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# If you want to get_images, you'll also need convert from ImageMagick
##########################################################################

VERSION := 2.1.5
VERSION := 2.1.8

## usage

Expand Down
8 changes: 7 additions & 1 deletion components/ItemGrid/GridItemSmall.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "pkg:/source/utils/config.bs"
sub init()
m.itemPoster = m.top.findNode("itemPoster")
m.posterText = m.top.findNode("posterText")
m.title = m.top.findNode("title")
initTitle()
m.posterText.font.size = 30
m.title.font.size = 25
m.backdrop = m.top.findNode("backdrop")
Expand All @@ -23,6 +23,10 @@ sub init()
end if
end sub

sub initTitle()
m.title = m.top.findNode("title")
end sub

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

Expand Down Expand Up @@ -54,6 +58,8 @@ sub itemContentChanged()
end sub

sub focusChanged()
if not isValid(m.title) then initTitle()

if m.top.itemHasFocus = true
m.title.repeatCount = -1
else
Expand Down
27 changes: 21 additions & 6 deletions components/ItemGrid/LoadVideoContentTask.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "pkg:/source/utils/config.bs"
import "pkg:/source/api/Image.bs"
import "pkg:/source/api/userauth.bs"
import "pkg:/source/utils/deviceCapabilities.bs"
import "pkg:/source/utils/session.bs"

enum SubtitleSelection
notset = -2
Expand Down Expand Up @@ -73,8 +74,6 @@ end function
sub LoadItems_AddVideoContent(video as object, mediaSourceId as dynamic, audio_stream_idx = 1 as integer, forceTranscoding = false as boolean)

meta = ItemMetaData(video.id)
subtitle_idx = m.top.selectedSubtitleIndex

if not isValid(meta)
video.errorMsg = "Error loading metadata"
video.content = invalid
Expand All @@ -85,6 +84,20 @@ sub LoadItems_AddVideoContent(video as object, mediaSourceId as dynamic, audio_s
userSession = m.global.session.user
userSettings = userSession.settings

session.video.Update(meta)

if isValid(meta.json.MediaSources[0].RunTimeTicks)
if meta.json.MediaSources[0].RunTimeTicks = 0
video.length = 0
else
video.length = meta.json.MediaSources[0].RunTimeTicks / 10000000
end if
end if
if isValid(meta.json.MediaSources[0]) and isValid(meta.json.MediaSources[0].MediaStreams[0])
video.MaxVideoDecodeResolution = [meta.json.MediaSources[0].MediaStreams[0].Width, meta.json.MediaSources[0].MediaStreams[0].Height]
end if

subtitle_idx = m.top.selectedSubtitleIndex
videotype = LCase(meta.type)

' Check for any Live TV streams or Recordings coming from other places other than the TV Guide
Expand Down Expand Up @@ -202,12 +215,10 @@ sub LoadItems_AddVideoContent(video as object, mediaSourceId as dynamic, audio_s
}
end if


' 'TODO: allow user selection of subtitle track before playback initiated, for now set to no subtitles
video.directPlaySupported = m.playbackInfo.MediaSources[0].SupportsDirectPlay
fully_external = false


' For h264/hevc video, Roku spec states that it supports specfic encoding levels
' The device can decode content with a Higher Encoding level but may play it back with certain
' artifacts. If the user preference is set, and the only reason the server says we need to
Expand Down Expand Up @@ -357,11 +368,15 @@ sub addVideoContentURL(video, mediaSourceId, audio_stream_idx, fully_external)
protocol = LCase(m.playbackInfo.MediaSources[0].Protocol)
if protocol <> "file"
uri = parseUrl(m.playbackInfo.MediaSources[0].Path)
if isLocalhost(uri[2])
if not isValidAndNotEmpty(uri) then return

if isValid(uri[2]) and isLocalhost(uri[2])
' if the domain of the URI is local to the server,
' create a new URI by appending the received path to the server URL
' later we will substitute the users provided URL for this case
video.content.url = buildURL(uri[4])
if isValid(uri[4])
video.content.url = buildURL(uri[4])
end if
else
fully_external = true
video.content.url = m.playbackInfo.MediaSources[0].Path
Expand Down
2 changes: 0 additions & 2 deletions components/ItemGrid/MusicArtistGridItem.bs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ sub init()
m.itemPoster.loadDisplayMode = m.topParent.imageDisplayMode
end if

m.gridTitles = m.global.session.user.settings["itemgrid.gridTitles"]
m.posterText.visible = false
m.postTextBackground.visible = false

end sub

sub itemContentChanged()
Expand Down
17 changes: 14 additions & 3 deletions components/captionTask.bs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import "pkg:/source/utils/config.bs"
import "pkg:/source/api/baserequest.bs"
import "pkg:/source/roku_modules/log/LogMixin.brs"

sub init()
m.log = log.Logger("captionTask")
m.top.observeField("url", "fetchCaption")
m.top.currentCaption = []
m.top.currentPos = 0
Expand Down Expand Up @@ -41,17 +43,26 @@ sub setFont()
end sub

sub fetchCaption()
m.log.debug("start fetchCaption()")
m.captionTimer.control = "stop"
re = CreateObject("roRegex", "(http.*?\.vtt)", "s")
url = re.match(m.top.url)[0]

if url <> invalid
port = createObject("roMessagePort")
m.reader.setUrl(url)
text = m.reader.GetToString()
m.captionList = parseVTT(text)
m.captionTimer.control = "start"
m.reader.setMessagePort(port)
if m.reader.AsyncGetToString()
msg = port.waitMessage(0)
if type(msg) = "roUrlEvent"
m.captionList = parseVTT(msg.GetString())
m.captionTimer.control = "start"
end if
end if
else
m.captionTimer.control = "stop"
end if
m.log.debug("end fetchCaption()", url)
end sub

function newlabel(txt)
Expand Down
5 changes: 4 additions & 1 deletion components/data/PersonData.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import "pkg:/source/utils/config.bs"

sub setFields()
json = m.top.json
m.top.Type = "Person"

if json = invalid then return

m.top.id = json.id
m.top.favorite = json.UserData.isFavorite
m.top.Type = "Person"
setPoster()
end sub

Expand Down
21 changes: 17 additions & 4 deletions components/home/HomeItem.bs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ sub init()
initItemPoster()
m.itemProgress = m.top.findNode("progress")
m.itemProgressBackground = m.top.findNode("progressBackground")
m.itemIcon = m.top.findNode("itemIcon")
initItemIcon()
initItemTextExtra()
m.itemPoster.observeField("loadStatus", "onPosterLoadStatusChanged")
m.unplayedCount = m.top.findNode("unplayedCount")
m.unplayedEpisodeCount = m.top.findNode("unplayedEpisodeCount")
m.playedIndicator = m.top.findNode("playedIndicator")
initPlayedIndicator()

m.showProgressBarAnimation = m.top.findNode("showProgressBar")
m.showProgressBarField = m.top.findNode("showProgressBarField")
Expand Down Expand Up @@ -50,6 +50,14 @@ sub initBackdrop()
m.backdrop = m.top.findNode("backdrop")
end sub

sub initItemIcon()
m.itemIcon = m.top.findNode("itemIcon")
end sub

sub initPlayedIndicator()
m.playedIndicator = m.top.findNode("playedIndicator")
end sub

sub itemContentChanged()
if isValid(m.unplayedCount) then m.unplayedCount.visible = false
itemData = m.top.itemContent
Expand All @@ -63,6 +71,8 @@ sub itemContentChanged()
if not isValid(m.itemText) then initItemText()
if not isValid(m.itemTextExtra) then initItemTextExtra()
if not isValid(m.backdrop) then initBackdrop()
if not isValid(m.itemIcon) then initItemIcon()
if not isValid(m.playedIndicator) then initPlayedIndicator()

m.itemPoster.width = itemData.imageWidth
m.itemText.maxWidth = itemData.imageWidth
Expand All @@ -83,11 +93,14 @@ sub itemContentChanged()

if LCase(itemData.type) = "series"
if isValid(userSettings)
if not userSettings["ui.tvshows.disableUnwatchedEpisodeCount"]
unwatchedEpisodeCountSetting = userSettings["ui.tvshows.disableUnwatchedEpisodeCount"]
if isValid(unwatchedEpisodeCountSetting) and not unwatchedEpisodeCountSetting
if isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount)
if itemData.json.UserData.UnplayedItemCount > 0
if isValid(m.unplayedCount) then m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
if isValid(m.unplayedEpisodeCount)
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
end if
end if
end if
end if
Expand Down
4 changes: 3 additions & 1 deletion components/tvshows/TVListDetails.bs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ sub itemContentChanged()
item.selectedVideoStreamId = itemData.MediaSources[0].id
end if

if isValid(itemData.indexNumber)
if isValid(itemData.parentIndexNumber) and itemData.parentIndexNumber = 0
indexNumber = `${tr("Special")} - `
else if isValid(itemData.indexNumber)
indexNumber = `${itemData.indexNumber}. `
if isValid(itemData.indexNumberEnd)
indexNumber = `${itemData.indexNumber}-${itemData.indexNumberEnd}. `
Expand Down
9 changes: 6 additions & 3 deletions components/tvshows/TVShowDetails.bs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,12 @@ end function

sub onShuffleEpisodeDataLoaded()
m.getShuffleEpisodesTask.unobserveField("data")
queueManager = m.global.queueManager
queueManager.callFunc("set", m.getShuffleEpisodesTask.data.items)
queueManager.callFunc("playQueue")

if isValid(m.getShuffleEpisodesTask.data)
queueManager = m.global.queueManager
queueManager.callFunc("set", m.getShuffleEpisodesTask.data.items)
queueManager.callFunc("playQueue")
end if
end sub

function onKeyEvent(key as string, press as boolean) as boolean
Expand Down
Loading

0 comments on commit 79d671d

Please sign in to comment.