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

Auto Reload LiveTv when feed Errors #669

Merged
merged 21 commits into from
Sep 12, 2022
Merged
Changes from 2 commits
Commits
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
45 changes: 5 additions & 40 deletions source/Main.brs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ sub Main (args as dynamic) as void
' Set global constants
setConstants()

' Write screen tracker for screensaver
WriteAsciiFile("tmp:/scene.temp", "")
MoveFile("tmp:/scene.temp", "tmp:/scene")

' Temporary code to migrate MPEG2 setting from device setting to user setting
' Added for 1.4.13 release and should probably be removed for 1.4.15
if get_setting("playback.mpeg2") <> invalid and registry_read("playback.mpeg2", get_setting("active_user")) = invalid
Expand Down Expand Up @@ -158,12 +154,6 @@ sub Main (args as dynamic) as void
end if
else if selectedItem.type = "Photo"
' Nothing to do here, handled in ItemGrid
else if selectedItem.type = "MusicArtist"
group = CreateMusicArtistDetailsGroup(selectedItem.json)
else if selectedItem.type = "MusicAlbum"
group = CreateMusicAlbumDetailsGroup(selectedItem.json)
else if selectedItem.type = "Audio"
group = CreateAudioPlayerGroup([selectedItem.json])
else
' TODO - switch on more node types
message_dialog(Substitute(tr("{0} support is coming soon!"), selectedItem.type))
Expand All @@ -183,31 +173,6 @@ sub Main (args as dynamic) as void
series = msg.getRoSGNode()
node = series.seasonData.items[ptr[1]]
group = CreateSeasonDetailsGroup(series.itemContent, node)
else if isNodeEvent(msg, "musicAlbumSelected")
' If you select a Music Album from ANYWHERE, follow this flow
ptr = msg.getData()
' ptr is for [row, col] of selected item... but we only have 1 row
albums = msg.getRoSGNode()
node = albums.musicArtistAlbumData.items[ptr[1]]
group = CreateMusicAlbumDetailsGroup(node)
else if isNodeEvent(msg, "playSong")
' User has selected audio they want us to play
selectedIndex = msg.getData()
screenContent = msg.getRoSGNode()
group = CreateAudioPlayerGroup([screenContent.albumData.items[selectedIndex]])
else if isNodeEvent(msg, "playAllSelected")
' User has selected playlist of of audio they want us to play
screenContent = msg.getRoSGNode()
m.spinner = screenContent.findNode("spinner")
m.spinner.visible = true
group = CreateAudioPlayerGroup(screenContent.albumData.items)
else if isNodeEvent(msg, "instantMixSelected")
' User has selected instant mix
' User has selected playlist of of audio they want us to play
screenContent = msg.getRoSGNode()
m.spinner = screenContent.findNode("spinner")
m.spinner.visible = true
group = CreateInstantMixGroup(screenContent.albumData.items)
else if isNodeEvent(msg, "episodeSelected")
' If you select a TV Episode from ANYWHERE, follow this flow
node = getMsgPicker(msg, "picker")
Expand Down Expand Up @@ -341,7 +306,11 @@ sub Main (args as dynamic) as void
end if
else if isNodeEvent(msg, "state")
node = msg.getRoSGNode()
if node.state = "finished"
if selectedItem.Type = "TvChannel" and node.state = "finished"
sceneManager.callFunc("popScene")
video = CreateVideoPlayerGroup(node.id)
sceneManager.callFunc("pushScene", video)
else if node.state = "finished"
node.control = "stop"
if node.showID = invalid
sceneManager.callFunc("popScene")
Expand Down Expand Up @@ -537,10 +506,6 @@ end sub

sub RunScreenSaver()
print "Starting screensaver..."

scene = ReadAsciiFile("tmp:/scene")
if scene = "nowplaying" then return

screen = createObject("roSGScreen")
m.port = createObject("roMessagePort")
screen.setMessagePort(m.port)
Expand Down