diff --git a/components/data/SceneManager.brs b/components/data/SceneManager.brs
index dd9cea41..04b80d22 100755
--- a/components/data/SceneManager.brs
+++ b/components/data/SceneManager.brs
@@ -245,14 +245,6 @@ sub userMessage(title as string, message as string)
m.scene.dialog = dialog
end sub
-'
-' Display Dialog to show user app is fetching server data
-sub progressDialog(title as string)
- dialog = createObject("roSGNode", "ProgressDialog")
- dialog.title = title
- m.scene.dialog = dialog
-end sub
-
'
' Close currently displayed dialog
sub dismiss_dialog()
diff --git a/components/data/SceneManager.xml b/components/data/SceneManager.xml
index 7534d617..42e947b0 100755
--- a/components/data/SceneManager.xml
+++ b/components/data/SceneManager.xml
@@ -9,8 +9,6 @@
-
-
diff --git a/components/movies/MovieDetails.brs b/components/movies/MovieDetails.brs
index bccffa80..fd0b5fb0 100644
--- a/components/movies/MovieDetails.brs
+++ b/components/movies/MovieDetails.brs
@@ -25,7 +25,6 @@ sub init()
m.trailerButton.text = tr("Play Trailer")
m.top.observeField("itemContent", "itemContentChanged")
- m.top.findNode("communityRatingGroup").visible = false
end sub
sub OnScreenShown()
diff --git a/components/movies/MovieDetails.xml b/components/movies/MovieDetails.xml
index 507e23d2..ff0ba871 100644
--- a/components/movies/MovieDetails.xml
+++ b/components/movies/MovieDetails.xml
@@ -8,7 +8,7 @@
-
+
diff --git a/locale/en_US/translations.ts b/locale/en_US/translations.ts
index 2899a4f5..e5b0b3d6 100644
--- a/locale/en_US/translations.ts
+++ b/locale/en_US/translations.ts
@@ -1021,18 +1021,6 @@
If enabled, the star and community rating for episodes of a TV show will be removed. This is to prevent spoilers of an upcoming good/bad episode.
-
-
- Loading Episode Options
-
-
-
- Loading Video Options
-
-
-
- Loading Movie Options
- Playback Bitrate Limits
diff --git a/source/Main.brs b/source/Main.brs
index 329dc3f3..885b2836 100644
--- a/source/Main.brs
+++ b/source/Main.brs
@@ -119,10 +119,8 @@ sub Main (args as dynamic) as void
if itemNode = invalid or itemNode.id = "" then return
if itemNode.type = "Episode" or itemNode.type = "Movie" or itemNode.type = "Video"
if itemNode.type = "Episode" and itemNode.selectedAudioStreamIndex <> invalid and itemNode.selectedAudioStreamIndex > 1
- m.global.sceneManager.callFunc("progressDialog", tr("Loading Episode Options"))
video = CreateVideoPlayerGroup(itemNode.id, invalid, itemNode.selectedAudioStreamIndex)
else
- m.global.sceneManager.callFunc("progressDialog", tr("Loading Video Options"))
video = CreateVideoPlayerGroup(itemNode.id)
end if
if video <> invalid and video.errorMsg <> "introaborted"
@@ -167,7 +165,6 @@ sub Main (args as dynamic) as void
group = CreateItemGrid(selectedItem)
sceneManager.callFunc("pushScene", group)
else if selectedItem.type = "Episode"
- m.global.sceneManager.callFunc("progressDialog", tr("Loading Episode Options"))
' play episode
' todo: create an episode page to link here
video_id = selectedItem.id
@@ -238,7 +235,6 @@ sub Main (args as dynamic) as void
node = getMsgPicker(msg, "picker")
group = CreateMovieDetailsGroup(node)
else if isNodeEvent(msg, "seriesSelected")
- m.global.sceneManager.callFunc("progressDialog", tr("Loading Seriers Options"))
' If you select a TV Series from ANYWHERE, follow this flow
node = getMsgPicker(msg, "picker")
group = CreateSeriesDetailsGroup(node)
@@ -320,7 +316,6 @@ sub Main (args as dynamic) as void
else if isNodeEvent(msg, "episodeSelected")
' If you select a TV Episode from ANYWHERE, follow this flow
m.selectedItemType = "Episode"
- m.global.sceneManager.callFunc("progressDialog", tr("Loading Episode Options"))
node = getMsgPicker(msg, "picker")
video_id = node.id
if node.selectedAudioStreamIndex <> invalid and node.selectedAudioStreamIndex > 1
@@ -369,7 +364,6 @@ sub Main (args as dynamic) as void
group = CreateVideoPlayerGroup(node.id)
sceneManager.callFunc("pushScene", group)
else if node.type = "Episode"
- m.global.sceneManager.callFunc("progressDialog", tr("Loading Episode Options"))
group = CreateVideoPlayerGroup(node.id)
sceneManager.callFunc("pushScene", group)
else if node.type = "Audio"
@@ -387,7 +381,6 @@ sub Main (args as dynamic) as void
btn = getButton(msg)
group = sceneManager.callFunc("getActiveScene")
if btn <> invalid and btn.id = "play-button"
- m.global.sceneManager.callFunc("progressDialog", tr("Loading Movie Options"))
' Check if a specific Audio Stream was selected
audio_stream_idx = 1
diff --git a/source/ShowScenes.brs b/source/ShowScenes.brs
index a0da9296..269cdf54 100644
--- a/source/ShowScenes.brs
+++ b/source/ShowScenes.brs
@@ -331,6 +331,7 @@ function CreateHomeGroup()
end function
function CreateMovieDetailsGroup(movie)
+ startLoadingSpinner()
group = CreateObject("roSGNode", "MovieDetails")
group.overhangTitle = movie.title
group.optionsAvailable = false
@@ -353,15 +354,17 @@ function CreateMovieDetailsGroup(movie)
extras = group.findNode("extrasGrid")
extras.observeField("selectedItem", m.port)
extras.callFunc("loadParts", movie.json)
-
+ stopLoadingSpinner()
return group
end function
function CreateSeriesDetailsGroup(series)
+ startLoadingSpinner()
' Get season data early in the function so we can check number of seasons.
seasonData = TVSeasons(series.id)
' Divert to season details if user setting goStraightToEpisodeListing is enabled and only one season exists.
if get_user_setting("ui.tvshows.goStraightToEpisodeListing") = "true" and seasonData.Items.Count() = 1
+ stopLoadingSpinner()
return CreateSeasonDetailsGroupByID(series.id, seasonData.Items[0].id)
end if
group = CreateObject("roSGNode", "TVShowDetails")
@@ -376,7 +379,7 @@ function CreateSeriesDetailsGroup(series)
extras = group.findNode("extrasGrid")
extras.observeField("selectedItem", m.port)
extras.callFunc("loadParts", group.itemcontent.json)
-
+ stopLoadingSpinner()
return group
end function
@@ -446,6 +449,7 @@ function CreateAlbumView(album)
end function
function CreateSeasonDetailsGroup(series, season)
+ startLoadingSpinner()
group = CreateObject("roSGNode", "TVEpisodes")
group.optionsAvailable = false
m.global.sceneManager.callFunc("pushScene", group)
@@ -456,10 +460,13 @@ function CreateSeasonDetailsGroup(series, season)
group.observeField("episodeSelected", m.port)
group.observeField("quickPlayNode", m.port)
+ stopLoadingSpinner()
+
return group
end function
function CreateSeasonDetailsGroupByID(seriesID, seasonID)
+ startLoadingSpinner()
group = CreateObject("roSGNode", "TVEpisodes")
group.optionsAvailable = false
m.global.sceneManager.callFunc("pushScene", group)
@@ -469,7 +476,7 @@ function CreateSeasonDetailsGroupByID(seriesID, seasonID)
group.observeField("episodeSelected", m.port)
group.observeField("quickPlayNode", m.port)
-
+ stopLoadingSpinner()
return group
end function
@@ -513,7 +520,7 @@ sub CreateSidePanel(buttons, options)
end sub
function CreateVideoPlayerGroup(video_id, mediaSourceId = invalid, audio_stream_idx = 1, forceTranscoding = false, showIntro = true, allowResumeDialog = true)
-
+ startMediaLoadingSpinner()
' Video is Playing
video = VideoPlayer(video_id, mediaSourceId, audio_stream_idx, defaultSubtitleTrackFromVid(video_id), forceTranscoding, showIntro, allowResumeDialog)
@@ -522,17 +529,18 @@ function CreateVideoPlayerGroup(video_id, mediaSourceId = invalid, audio_stream_
video.observeField("selectSubtitlePressed", m.port)
video.observeField("selectPlaybackInfoPressed", m.port)
video.observeField("state", m.port)
-
+ stopLoadingSpinner()
return video
end function
function CreatePersonView(personData as object) as object
+ startLoadingSpinner()
person = CreateObject("roSGNode", "PersonDetails")
m.global.SceneManager.callFunc("pushScene", person)
info = ItemMetaData(personData.id)
person.itemContent = info
-
+ stopLoadingSpinner()
person.setFocus(true)
person.observeField("selectedItem", m.port)
person.findNode("favorite-button").observeField("buttonSelected", m.port)
diff --git a/source/VideoPlayer.brs b/source/VideoPlayer.brs
index cc4c56c5..0a611c2b 100644
--- a/source/VideoPlayer.brs
+++ b/source/VideoPlayer.brs
@@ -9,6 +9,7 @@ function VideoPlayer(id, mediaSourceId = invalid, audio_stream_idx = 1, subtitle
end if
if video.content = invalid
+ stopLoadingSpinner()
return invalid
end if
jellyfin_blue = "#00a4dcFF"
@@ -57,7 +58,9 @@ sub AddVideoContent(video, mediaSourceId, audio_stream_idx = 1, subtitle_idx = -
playbackPosition = meta.json.UserData.PlaybackPositionTicks
if allowResumeDialog
if playbackPosition > 0
+ stopLoadingSpinner()
dialogResult = startPlayBackOver(playbackPosition)
+ startMediaLoadingSpinner()
'Dialog returns -1 when back pressed, 0 for resume, and 1 for start over
if dialogResult = -1
'User pressed back, return invalid and don't load video
@@ -311,7 +314,6 @@ sub AddVideoContent(video, mediaSourceId, audio_stream_idx = 1, subtitle_idx = -
if not fully_external
video.content = authorize_request(video.content)
end if
- m.global.sceneManager.callFunc("dismiss_dialog")
end sub
function PlayIntroVideo(video_id, audio_stream_idx) as boolean
@@ -368,8 +370,6 @@ end function
'Opens dialog asking user if they want to resume video or start playback over only on the home screen
function startPlayBackOver(time as longinteger) as integer
- 'Closes Loading Dialog
- m.global.sceneManager.callFunc("dismiss_dialog")
if m.scene.focusedChild.focusedChild.overhangTitle = tr("Home") and (m.videotype = "Episode" or m.videotype = "Series")
return option_dialog([tr("Resume playing at ") + ticksToHuman(time) + ".", tr("Start over from the beginning."), tr("Watched"), tr("Go to series"), tr("Go to season"), tr("Go to episode")])
else
diff --git a/source/utils/misc.brs b/source/utils/misc.brs
index 7521ce49..e9373081 100644
--- a/source/utils/misc.brs
+++ b/source/utils/misc.brs
@@ -281,3 +281,28 @@ function findNodeBySubtype(node, subtype)
return foundNodes
end function
+
+sub startLoadingSpinner()
+ m.spinner = createObject("roSGNode", "Spinner")
+ m.spinner.translation = "[900, 450]"
+ m.spinner.visible = true
+ m.scene.appendChild(m.spinner)
+end sub
+
+
+sub startMediaLoadingSpinner()
+ dialog = createObject("roSGNode", "ProgressDialog")
+ dialog.id = "invisibiledialog"
+ dialog.visible = false
+ m.scene.dialog = dialog
+ startLoadingSpinner()
+end sub
+
+sub stopLoadingSpinner()
+ if isValid(m.spinner)
+ m.spinner.visible = false
+ end if
+ if isValid(m.scene.dialog)
+ m.scene.dialog.close = true
+ end if
+end sub