Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 2.1.3 bugfixes into master #1876

Merged
merged 22 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ff36c00
Bump build version
jellyfin-bot Jul 22, 2024
6b6989a
Merge pull request #1848 from jellyfin/bump-bugfix-to-213
cewert Jul 22, 2024
d34afdf
validate data to prevent app crash
cewert Jul 24, 2024
cc31b08
fix app crash when server api request returns invalid
cewert Jul 24, 2024
9875727
prevent crash by validating we have access to global constants before…
cewert Jul 24, 2024
1114ec1
Merge pull request #1859 from cewert/fix-listposter-crash
cewert Jul 24, 2024
b8382f6
Merge pull request #1857 from cewert/fix-movielibrary-crash
cewert Jul 24, 2024
8a15bf8
Merge pull request #1858 from cewert/fix-loginflow-crash
cewert Jul 24, 2024
5328fc2
validate item.json before using to prevent crash
cewert Jul 25, 2024
a4ce646
validate node exists to prevent crash
cewert Jul 25, 2024
57672a5
validate animation node exists to prevent crash
cewert Jul 25, 2024
b6408b5
don't divide by zero
cewert Jul 25, 2024
7405b7c
add validation to prevent crash
cewert Jul 25, 2024
4dccbc0
Merge pull request #1867 from cewert/fix-videoplayer-crash
cewert Jul 25, 2024
c9c0404
Merge pull request #1868 from cewert/fix-videoplayer-crash2
cewert Jul 25, 2024
c030228
Merge pull request #1866 from cewert/fix-moviedetails-crash3
cewert Jul 25, 2024
950bb60
validate nodes exist to prevent crash
cewert Jul 28, 2024
d1a2d11
Merge pull request #1865 from cewert/fix-moviedetails-crash2
cewert Jul 28, 2024
b667825
Merge branch '2.1.z' into fix-moviedetails-crash
cewert Jul 28, 2024
2323d42
fix error in merge conflict
cewert Jul 28, 2024
0539e1b
Merge pull request #1864 from cewert/fix-moviedetails-crash
cewert Jul 28, 2024
b748dd4
Merge pull request #1870 from cewert/fix-homeitem-crash
cewert Jul 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.2
VERSION := 2.1.3

## usage

Expand Down
2 changes: 1 addition & 1 deletion components/ItemGrid/MovieLibraryView.bs
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ end sub
'
'Swap Complete
sub swapDone()
if m.swapAnimation.state = "stopped"
if isValid(m.swapAnimation) and m.swapAnimation.state = "stopped"
'Set main BG node image and hide transitioning node
m.backdrop.uri = m.newBackdrop.uri
m.backdrop.opacity = 1
Expand Down
12 changes: 9 additions & 3 deletions components/ListPoster.bs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ sub init()

m.backdrop = m.top.findNode("backdrop")

' Randmomise the background colors
posterBackgrounds = m.global.constants.poster_bg_pallet
m.backdrop.color = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
' Randomize the background colors
backdropColor = "#00a4db" ' set default in case global var is invalid
localGlobal = m.global

if isValid(localGlobal) and isValid(localGlobal.constants) and isValid(localGlobal.constants.poster_bg_pallet)
posterBackgrounds = localGlobal.constants.poster_bg_pallet
backdropColor = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
end if

m.backdrop.color = backdropColor
updateSize()
end sub

Expand Down
22 changes: 19 additions & 3 deletions components/home/HomeItem.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import "pkg:/source/roku_modules/log/LogMixin.brs"

sub init()
m.log = log.Logger("HomeItem")
m.itemText = m.top.findNode("itemText")
m.itemPoster = m.top.findNode("itemPoster")
initItemText()
initItemPoster()
m.itemProgress = m.top.findNode("progress")
m.itemProgressBackground = m.top.findNode("progressBackground")
m.itemIcon = m.top.findNode("itemIcon")
m.itemTextExtra = m.top.findNode("itemTextExtra")
initItemTextExtra()
m.itemPoster.observeField("loadStatus", "onPosterLoadStatusChanged")
m.unplayedCount = m.top.findNode("unplayedCount")
m.unplayedEpisodeCount = m.top.findNode("unplayedEpisodeCount")
Expand All @@ -34,6 +34,17 @@ sub init()
m.backdrop.color = backdropColor
end sub

sub initItemText()
m.itemText = m.top.findNode("itemText")
end sub

sub initItemPoster()
m.itemPoster = m.top.findNode("itemPoster")
end sub

sub initItemTextExtra()
m.itemTextExtra = m.top.findNode("itemTextExtra")
end sub

sub itemContentChanged()
if isValid(m.unplayedCount) then m.unplayedCount.visible = false
Expand All @@ -43,6 +54,11 @@ sub itemContentChanged()

itemData.Title = itemData.name ' Temporarily required while we move from "HomeItem" to "JFContentItem"

' validate to prevent crash
if not isValid(m.itemPoster) then initItemPoster()
if not isValid(m.itemText) then initItemText()
if not isValid(m.itemTextExtra) then initItemTextExtra()

m.itemPoster.width = itemData.imageWidth
m.itemText.maxWidth = itemData.imageWidth
m.itemTextExtra.width = itemData.imageWidth
Expand Down
156 changes: 80 additions & 76 deletions components/movies/MovieDetails.bs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ end sub
' onMoviePosterSwapAnimationStateChange: Handler for changes to m.moviePosterSwapAnimation.state
'
sub onMoviePosterSwapAnimationStateChange()
if not isValid(m.moviePosterSwapAnimation) then return
if LCase(m.moviePosterSwapAnimation.state) <> "stopped" then return
m.moviePoster.uri = m.moviePosterSwap.uri
m.moviePoster.opacity = 1
Expand Down Expand Up @@ -95,102 +96,105 @@ end sub
sub itemContentChanged()
' Updates video metadata
item = m.top.itemContent
itemData = item.json
m.top.id = itemData.id
m.top.findNode("moviePoster").uri = m.top.itemContent.posterURL

' Set default video source if user hasn't selected one yet
if m.top.selectedVideoStreamId = "" and isValid(itemData.MediaSources)
m.top.selectedVideoStreamId = itemData.MediaSources[0].id
end if
if isValid(item) and isValid(item.json)
itemData = item.json
m.top.id = itemData.id
m.top.findNode("moviePoster").uri = m.top.itemContent.posterURL

' Set default video source if user hasn't selected one yet
if m.top.selectedVideoStreamId = "" and isValid(itemData.MediaSources)
m.top.selectedVideoStreamId = itemData.MediaSources[0].id
end if

' Find first Audio Stream and set that as default
SetDefaultAudioTrack(itemData)
' Find first Audio Stream and set that as default
SetDefaultAudioTrack(itemData)

' Handle all "As Is" fields
m.top.overhangTitle = itemData.name
setFieldText("releaseYear", itemData.productionYear)
setFieldText("overview", itemData.overview)
' Handle all "As Is" fields
m.top.overhangTitle = itemData.name
setFieldText("releaseYear", itemData.productionYear)
setFieldText("overview", itemData.overview)

if itemData.officialRating <> invalid
setFieldText("officialRating", itemData.officialRating)
else
m.infoGroup.removeChild(m.top.findNode("officialRating"))
end if

if m.global.session.user.settings["ui.movies.showRatings"]
if isValid(itemData.communityRating)
setFieldText("communityRating", int(itemData.communityRating * 10) / 10)
if itemData.officialRating <> invalid
setFieldText("officialRating", itemData.officialRating)
else
m.infoGroup.removeChild(m.top.findNode("communityRatingGroup"))
m.infoGroup.removeChild(m.top.findNode("officialRating"))
end if
if isValid(itemData.CriticRating)
setFieldText("criticRatingLabel", itemData.criticRating)
if itemData.CriticRating > 60
tomato = "pkg:/images/fresh.png"

if m.global.session.user.settings["ui.movies.showRatings"]
if isValid(itemData.communityRating)
setFieldText("communityRating", int(itemData.communityRating * 10) / 10)
else
m.infoGroup.removeChild(m.top.findNode("communityRatingGroup"))
end if
if isValid(itemData.CriticRating)
setFieldText("criticRatingLabel", itemData.criticRating)
if itemData.CriticRating > 60
tomato = "pkg:/images/fresh.png"
else
tomato = "pkg:/images/rotten.png"
end if
criticRatingIcon = m.top.findNode("criticRatingIcon")
if isValid(criticRatingIcon) then criticRatingIcon.uri = tomato
else
tomato = "pkg:/images/rotten.png"
m.infoGroup.removeChild(m.top.findNode("criticRatingGroup"))
end if
m.top.findNode("criticRatingIcon").uri = tomato
else
m.infoGroup.removeChild(m.top.findNode("communityRatingGroup"))
m.infoGroup.removeChild(m.top.findNode("criticRatingGroup"))
end if
else
m.infoGroup.removeChild(m.top.findNode("communityRatingGroup"))
m.infoGroup.removeChild(m.top.findNode("criticRatingGroup"))
end if

if type(itemData.RunTimeTicks) = "LongInteger"
setFieldText("runtime", stri(getRuntime()) + " mins")
if m.global.session.user.settings["ui.design.hideclock"] <> true
setFieldText("ends-at", tr("Ends at %1").Replace("%1", getEndTime()))
if type(itemData.RunTimeTicks) = "LongInteger"
setFieldText("runtime", stri(getRuntime()) + " mins")
if m.global.session.user.settings["ui.design.hideclock"] <> true
setFieldText("ends-at", tr("Ends at %1").Replace("%1", getEndTime()))
end if
end if
end if

if itemData.genres.count() > 0
setFieldText("genres", tr("Genres") + ": " + itemData.genres.join(", "))
else
m.top.findNode("details").removeChild(m.top.findNode("genres"))
end if
if itemData.genres.count() > 0
setFieldText("genres", tr("Genres") + ": " + itemData.genres.join(", "))
else
m.top.findNode("details").removeChild(m.top.findNode("genres"))
end if

' show tags if there are no genres to display
if itemData.genres.count() = 0 and isValid(itemData.tags) and itemData.tags.count() > 0
setFieldText("genres", tr("Tags") + ": " + itemData.tags.join(", "))
end if
' show tags if there are no genres to display
if itemData.genres.count() = 0 and isValid(itemData.tags) and itemData.tags.count() > 0
setFieldText("genres", tr("Tags") + ": " + itemData.tags.join(", "))
end if

directors = []
for each person in itemData.people
if person.type = "Director"
directors.push(person.name)
directors = []
for each person in itemData.people
if person.type = "Director"
directors.push(person.name)
end if
end for
if directors.count() > 0
setFieldText("director", tr("Director") + ": " + directors.join(", "))
else
m.top.findNode("details").removeChild(m.top.findNode("director"))
end if
end for
if directors.count() > 0
setFieldText("director", tr("Director") + ": " + directors.join(", "))
else
m.top.findNode("details").removeChild(m.top.findNode("director"))
end if

if m.global.session.user.settings["ui.details.hidetagline"] = false
if itemData.taglines.count() > 0
setFieldText("tagline", itemData.taglines[0])
if m.global.session.user.settings["ui.details.hidetagline"] = false
if itemData.taglines.count() > 0
setFieldText("tagline", itemData.taglines[0])
end if
else
m.details.removeChild(m.tagline)
end if
else
m.details.removeChild(m.tagline)
end if

'set aired date if type is Episode
if itemData.PremiereDate <> invalid and itemData.Type = "Episode"
airDate = CreateObject("roDateTime")
airDate.FromISO8601String(itemData.PremiereDate)
m.top.findNode("aired").text = tr("Aired") + ": " + airDate.AsDateString("short-month-no-weekday")
'remove movie release year label
m.infoGroup.removeChild(m.top.findNode("releaseYear"))
end if
'set aired date if type is Episode
if itemData.PremiereDate <> invalid and itemData.Type = "Episode"
airDate = CreateObject("roDateTime")
airDate.FromISO8601String(itemData.PremiereDate)
m.top.findNode("aired").text = tr("Aired") + ": " + airDate.AsDateString("short-month-no-weekday")
'remove movie release year label
m.infoGroup.removeChild(m.top.findNode("releaseYear"))
end if

setFavoriteColor()
setWatchedColor()
SetUpVideoOptions(itemData.mediaSources)
SetUpAudioOptions(itemData.mediaStreams)
setFavoriteColor()
setWatchedColor()
SetUpVideoOptions(itemData.mediaSources)
SetUpAudioOptions(itemData.mediaStreams)
end if
m.buttonGrp.visible = true
stopLoadingSpinner()
end sub
Expand Down
9 changes: 6 additions & 3 deletions components/video/VideoPlayerView.bs
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,12 @@ end sub

' When Video Player state changes
sub onPositionChanged()

' Pass video position data into OSD
m.osd.progressPercentage = m.top.position / m.top.duration
if m.top.duration = 0
m.osd.progressPercentage = 0
else
m.osd.progressPercentage = m.top.position / m.top.duration
end if
m.osd.positionTime = m.top.position
m.osd.remainingPositionTime = m.top.duration - m.top.position

Expand Down Expand Up @@ -662,7 +665,7 @@ sub ReportPlayback(state = "update" as string)
"PositionTicks": int(m.top.position) * 10000000&, 'Ensure a LongInteger is used
"IsPaused": (m.top.state = "paused")
}
if m.top.content.live
if isValid(m.top.content) and isValid(m.top.content.live) and m.top.content.live
params.append({
"MediaSourceId": m.top.transcodeParams.MediaSourceId,
"LiveStreamId": m.top.transcodeParams.LiveStreamId
Expand Down
2 changes: 1 addition & 1 deletion manifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
title=Jellyfin
major_version=2
minor_version=1
build_version=2
build_version=3

### Main Menu Icons / Channel Poster Artwork

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jellyfin-roku",
"type": "module",
"version": "2.1.2",
"version": "2.1.3",
"description": "Roku app for Jellyfin media server",
"dependencies": {
"@rokucommunity/bslib": "0.1.1",
Expand Down
5 changes: 3 additions & 2 deletions source/ShowScenes.bs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ function LoginFlow()
SendPerformanceBeacon("AppDialogInitiate") ' Roku Performance monitoring - Dialog Starting

publicUsers = GetPublicUsers()
savedUsers = getSavedUsers()
numPubUsers = 0
if isValid(publicUsers) then numPubUsers = publicUsers.count()

numPubUsers = publicUsers.count()
savedUsers = getSavedUsers()
numSavedUsers = savedUsers.count()

if numPubUsers > 0 or numSavedUsers > 0
Expand Down
Loading