Merge pull request #939 from jimdogx/JF-501-Crash-when-watching-inprogress-recording
Don't crash when viewing in progress recording.
This commit is contained in:
commit
3c850dcab0
|
@ -129,7 +129,7 @@ sub loadItems()
|
|||
tmp = CreateObject("roSGNode", "ChannelData")
|
||||
else if item.Type = "Folder" or item.Type = "ChannelFolderItem" or item.Type = "CollectionFolder"
|
||||
tmp = CreateObject("roSGNode", "FolderData")
|
||||
else if item.Type = "Video"
|
||||
else if item.Type = "Video" or item.Type = "Recording"
|
||||
tmp = CreateObject("roSGNode", "VideoData")
|
||||
else if item.Type = "Photo"
|
||||
tmp = CreateObject("roSGNode", "PhotoData")
|
||||
|
|
|
@ -30,7 +30,7 @@ sub AddVideoContent(video, mediaSourceId, audio_stream_idx = 1, subtitle_idx = -
|
|||
|
||||
' Special handling for "Programs" or "Vidoes" launched from "On Now" or elsewhere on the home screen...
|
||||
' basically anything that is a Live Channel.
|
||||
if meta.json.ChannelId <> invalid
|
||||
if isValid(meta?.json?.ChannelId)
|
||||
if meta.json.EpisodeTitle <> invalid
|
||||
meta.title = meta.json.EpisodeTitle
|
||||
else if meta.json.Name <> invalid
|
||||
|
@ -53,7 +53,7 @@ sub AddVideoContent(video, mediaSourceId, audio_stream_idx = 1, subtitle_idx = -
|
|||
video.content.title = meta.title
|
||||
video.showID = meta.showID
|
||||
|
||||
if playbackPosition = -1
|
||||
if playbackPosition = -1 and isValid(meta.json)
|
||||
playbackPosition = meta.json.UserData.PlaybackPositionTicks
|
||||
if allowResumeDialog
|
||||
if playbackPosition > 0
|
||||
|
@ -175,7 +175,17 @@ sub AddVideoContent(video, mediaSourceId, audio_stream_idx = 1, subtitle_idx = -
|
|||
if mediaSourceId = invalid
|
||||
mediaSourceId = video.id
|
||||
end if
|
||||
if meta.live then mediaSourceId = "" ' Don't send mediaSourceId for Live media
|
||||
|
||||
' Don't send mediaSourceId for Live Media
|
||||
' Note: Recordings in progress will have meta.live = invalid, but we still don't want to send mediaSourceId
|
||||
if not isValid(meta.live)
|
||||
meta.live = false
|
||||
mediaSourceId = ""
|
||||
else
|
||||
if meta.live
|
||||
mediaSourceId = ""
|
||||
end if
|
||||
end if
|
||||
|
||||
m.playbackInfo = ItemPostPlaybackInfo(video.id, mediaSourceId, audio_stream_idx, subtitle_idx, playbackPosition)
|
||||
video.videoId = video.id
|
||||
|
@ -197,7 +207,7 @@ sub AddVideoContent(video, mediaSourceId, audio_stream_idx = 1, subtitle_idx = -
|
|||
|
||||
video.container = getContainerType(meta)
|
||||
|
||||
if m.playbackInfo.MediaSources[0] = invalid
|
||||
if not isValid(m.playbackInfo.MediaSources[0]) and isValid(meta.json)
|
||||
m.playbackInfo = meta.json
|
||||
end if
|
||||
|
||||
|
@ -395,7 +405,7 @@ end function
|
|||
|
||||
function getContainerType(meta as object) as string
|
||||
' Determine the file type of the video file source
|
||||
if meta.json.mediaSources = invalid then return ""
|
||||
if not IsValid(meta.json) or not isValid(meta.json.mediaSources) then return ""
|
||||
|
||||
container = meta.json.mediaSources[0].container
|
||||
if container = invalid
|
||||
|
|
|
@ -156,6 +156,10 @@ function ItemMetaData(id as string)
|
|||
|
||||
tmp.json = data
|
||||
return tmp
|
||||
else if data.type = "Recording"
|
||||
' We know it's "Recording", but we don't do any special preprocessing
|
||||
' for this data type at the moment, so just return the json.
|
||||
return data
|
||||
else
|
||||
print "Items.brs::ItemMetaData processed unhandled type: " data.type
|
||||
' Return json if we don't know what it is
|
||||
|
|
Loading…
Reference in New Issue
Block a user