Merge pull request #1720 from cewert/merge-205-into-master

This commit is contained in:
Charles Ewert 2024-02-20 08:55:13 -05:00 committed by GitHub
commit 896efc645d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 72 additions and 31 deletions

View File

@ -3,7 +3,7 @@
# If you want to get_images, you'll also need convert from ImageMagick
##########################################################################
VERSION := 2.0.4
VERSION := 2.0.5
## usage

View File

@ -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

View File

@ -36,9 +36,10 @@ end sub
sub itemContentChanged()
m.unplayedCount.visible = false
if isValid(m.unplayedCount) then m.unplayedCount.visible = false
itemData = m.top.itemContent
if itemData = invalid then return
localGlobal = m.global
itemData.Title = itemData.name ' Temporarily required while we move from "HomeItem" to "JFContentItem"
@ -56,16 +57,17 @@ sub itemContentChanged()
if itemData.isWatched
m.playedIndicator.visible = true
m.unplayedCount.visible = false
else
m.playedIndicator.visible = false
if LCase(itemData.type) = "series"
if m.global.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"] = false
if 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
if isValid(localGlobal) and isValid(localGlobal.session) and isValid(localGlobal.session.user) and isValid(localGlobal.session.user.settings)
if not localGlobal.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"]
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
end if
end if
end if
end if

View File

@ -75,12 +75,17 @@ sub processUserSections()
m.expectedRowCount = 1 ' the favorites row is hardcoded to always show atm
m.processedRowCount = 0
sessionUser = m.global.session.user
' calculate expected row count by processing homesections
for i = 0 to 6
sectionName = LCase(m.global.session.user.settings["homesection" + i.toStr()])
userSection = sessionUser.settings["homesection" + i.toStr()]
sectionName = userSection ?? "none"
sectionName = LCase(sectionName)
if sectionName = "latestmedia"
' expect 1 row per filtered media library
m.filteredLatest = filterNodeArray(m.libraryData, "id", m.global.session.user.configuration.LatestItemsExcludes)
m.filteredLatest = filterNodeArray(m.libraryData, "id", sessionUser.configuration.LatestItemsExcludes)
for each latestLibrary in m.filteredLatest
if latestLibrary.collectionType <> "boxsets" and latestLibrary.collectionType <> "livetv" and latestLibrary.json.CollectionType <> "Program"
m.expectedRowCount++
@ -94,10 +99,10 @@ sub processUserSections()
' Add home sections in order based on user settings
loadedSections = 0
for i = 0 to 6
sectionName = m.global.session.user.settings["homesection" + i.toStr()]
if not isValid(sectionName) then exit for
userSection = sessionUser.settings["homesection" + i.toStr()]
sectionName = userSection ?? "none"
sectionName = LCase(sectionName)
sectionLoaded = false
if sectionName <> "none"
sectionLoaded = addHomeSection(sectionName)
@ -144,8 +149,13 @@ function getOriginalSectionIndex(sectionName as string) as integer
sectionIndex = 0
indexLatestMediaSection = 0
sessionUser = m.global.session.user
for i = 0 to 6
settingSectionName = LCase(m.global.session.user.settings["homesection" + i.toStr()])
userSection = sessionUser.settings["homesection" + i.toStr()]
settingSectionName = userSection ?? "none"
settingSectionName = LCase(settingSectionName)
if settingSectionName = "latestmedia"
indexLatestMediaSection = i
end if

View File

@ -362,6 +362,7 @@ sub onVideoContentLoaded()
m.top.audioIndex = videoContent[0].audioIndex
m.top.transcodeParams = videoContent[0].transcodeparams
m.chapters = videoContent[0].chapters
m.top.showID = videoContent[0].showID
m.osd.itemTitleText = m.top.content.title
@ -444,6 +445,11 @@ sub onNextEpisodeDataLoaded()
m.checkedForNextEpisode = true
m.top.observeField("position", "onPositionChanged")
' If there is no next episode, disable next episode button
if m.getNextEpisodeTask.nextEpisodeData.Items.count() <> 2
m.nextupbuttonseconds = 0
end if
end sub
'
@ -558,7 +564,7 @@ sub onState(msg)
m.top.backPressed = true
else if m.top.state = "playing"
' Check if next episde is available
' Check if next episode is available
if isValid(m.top.showID)
if m.top.showID <> "" and not m.checkedForNextEpisode and m.top.content.contenttype = 4
m.getNextEpisodeTask.showID = m.top.showID

View File

@ -3,7 +3,7 @@
title=Jellyfin
major_version=2
minor_version=0
build_version=4
build_version=5
### Main Menu Icons / Channel Poster Artwork

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "jellyfin-roku",
"version": "2.0.4",
"version": "2.0.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "jellyfin-roku",
"version": "2.0.4",
"version": "2.0.5",
"hasInstallScript": true,
"license": "GPL-2.0",
"dependencies": {

View File

@ -1,7 +1,7 @@
{
"name": "jellyfin-roku",
"type": "module",
"version": "2.0.4",
"version": "2.0.5",
"description": "Roku app for Jellyfin media server",
"dependencies": {
"@rokucommunity/bslib": "0.1.1",

View File

@ -0,0 +1,18 @@
[
{
"description": "Fix sporadic crash when viewing libraries",
"author": "cewert"
},
{
"description": "Prevent crash when homesection setting is invalid",
"author": "1hitsong"
},
{
"description": "Fix 2 sporadic crashes on home view",
"author": "cewert"
},
{
"description": "Only show Next Episode button if there is a next episode",
"author": "1hitsong"
}
]