Skip to content

Commit 6f566e1

Browse files
chore(docs): update code docs
1 parent 59749b1 commit 6f566e1

12 files changed

Lines changed: 115 additions & 11 deletions

docs/components_ItemDetails.bs.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3095,6 +3095,7 @@
30953095

30963096
if isValid(content) and content.count() > 0
30973097
m.top.quickPlayNode = content[0]
3098+
m.top.quickPlayNode = invalid
30983099
else
30993100
m.log.warn("Series Play: could not load first episode for series", m.top.itemContent.id)
31003101
m.global.sceneManager.callFunc("standardDialog", translate(translationKeys.ErrorPlaybackError), { data: ["<p>" + translate(translationKeys.ErrorCouldNotLoadTheFirstEpisode) + "</p>"] })
@@ -3129,6 +3130,7 @@
31293130
return true
31303131
else if focusedButton.id = "resumeButton" and isValid(m.top.nextUpEpisode) and isValidAndNotEmpty(m.top.nextUpEpisode.id)
31313132
m.top.quickPlayNode = m.top.nextUpEpisode
3133+
m.top.quickPlayNode = invalid
31323134
return true
31333135
end if
31343136
end if
@@ -3217,6 +3219,7 @@
32173219
else if key = "play" and m.extrasGrid.hasFocus()
32183220
if isValid(m.extrasGrid.focusedItem)
32193221
m.top.quickPlayNode = m.extrasGrid.focusedItem
3222+
m.top.quickPlayNode = invalid
32203223
return true
32213224
end if
32223225
end if
@@ -3228,6 +3231,19 @@
32283231
' Called automatically by SceneManager.popScene() / clearScenes()
32293232
sub destroy()
32303233
m.log.verbose("destroy")
3234+
3235+
' Tear down ExtrasRowList FIRST — stops in-flight tasks (including any
3236+
' LoadChannelProgramsTask started by onProgramsExpired) and unobserves all
3237+
' fields before we destroy the texture manager or null out references.
3238+
m.extrasGrid.callFunc("destroy")
3239+
3240+
' Unobserve m.port observers set by showScenes.bs CreateItemDetailsGroup().
3241+
' These persist until the node is garbage collected, so explicit cleanup
3242+
' prevents stale events from reaching main.bs's event loop after popScene.
3243+
m.top.unobserveField("quickPlayNode")
3244+
m.extrasGrid.unobserveField("selectedItem")
3245+
m.buttonGrp.unobserveField("buttonSelected")
3246+
32313247
destroyTextureManager(m.extrasGrid.content)
32323248

32333249
' Safety net: stop the loading spinner in case the component is destroyed

docs/components_ItemGrid_BaseGridView.bs.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,7 @@
10151015
if isValid(m.channelFocused)
10161016
m.log.debug("quickplay channel", "id", m.channelFocused.id, "type", m.channelFocused.type)
10171017
m.top.quickPlayNode = m.channelFocused
1018+
m.top.quickPlayNode = invalid
10181019
return true
10191020
end if
10201021
end if
@@ -1023,6 +1024,7 @@
10231024

10241025
if isValid(itemToPlay)
10251026
m.top.quickPlayNode = itemToPlay
1027+
m.top.quickPlayNode = invalid
10261028
return true
10271029
end if
10281030
else if key = "left"

docs/components_extras_ExtrasRowList.bs.html

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,9 @@
10521052

10531053
sub onRowItemSelected()
10541054
m.top.selectedItem = m.top.content.getChild(m.top.rowItemSelected[0]).getChild(m.top.rowItemSelected[1])
1055+
' Clear immediately — prevents stale value from re-firing the m.port
1056+
' observer when the parent ItemDetails screen is restored after popScene.
1057+
m.top.selectedItem = invalid
10551058
end sub
10561059

10571060
sub onRowItemFocused()
@@ -1125,6 +1128,67 @@
11251128
end if
11261129
end sub
11271130

1131+
' destroy: Full teardown releasing all resources before component removal.
1132+
' Called by ItemDetails.destroy() before nulling the extrasGrid reference.
1133+
sub destroy()
1134+
' Stop all in-flight tasks and unobserve their content fields
1135+
cancelInFlightChain()
1136+
1137+
' Stop and release the program progress timer (inherited from JRRowList)
1138+
stopProgramProgressTicking(true)
1139+
1140+
' Unobserve m.top fields set in init()
1141+
m.top.unobserveField("rowItemSelected")
1142+
m.top.unobserveField("rowItemFocused")
1143+
m.top.unobserveField("programsExpired")
1144+
1145+
' Release task references
1146+
m.LoadSeasonsTask = invalid
1147+
m.LoadSeasonAllEpisodesTask = invalid
1148+
m.LoadSeasonEpisodesTask = invalid
1149+
m.LoadAdditionalPartsTask = invalid
1150+
m.LoadPeopleTask = invalid
1151+
m.LikeThisTask = invalid
1152+
m.SpecialFeaturesTask = invalid
1153+
m.LoadMoviesTask = invalid
1154+
m.LoadShowsTask = invalid
1155+
m.LoadSeriesTask = invalid
1156+
m.LoadBoxSetItemsTask = invalid
1157+
m.LoadArtistAlbumsTask = invalid
1158+
m.LoadArtistAppearsOnTask = invalid
1159+
m.LoadArtistSongsTask = invalid
1160+
m.LoadArtistSimilarTask = invalid
1161+
m.LoadAlbumSongsTask = invalid
1162+
m.LoadPlaylistItemsTask = invalid
1163+
m.LoadPhotoAlbumItemsTask = invalid
1164+
m.LoadChannelProgramsTask = invalid
1165+
1166+
' Clear row references
1167+
m.rowChapters = invalid
1168+
m.rowAdditionalParts = invalid
1169+
m.rowSeasons = invalid
1170+
m.rowEpisodes = invalid
1171+
m.rowSeasonEpisodes = invalid
1172+
m.rowCast = invalid
1173+
m.rowLikeThis = invalid
1174+
m.rowSpecialFeatures = invalid
1175+
m.rowBoxSetItems = invalid
1176+
m.rowMovies = invalid
1177+
m.rowTvShows = invalid
1178+
m.rowSeries = invalid
1179+
m.rowArtistAlbums = invalid
1180+
m.rowArtistAppearsOn = invalid
1181+
m.rowArtistSongs = invalid
1182+
m.rowAlbumSongs = invalid
1183+
m.rowAlbumArtistAlbums = invalid
1184+
m.rowPlaylistItems = invalid
1185+
m.rowPhotoAlbumItems = invalid
1186+
m.rowChannelPrograms = invalid
1187+
1188+
' Reset flags
1189+
m.isRefetchingChannelPrograms = false
1190+
end sub
1191+
11281192
' onKeyEvent: Anticipate the next row on UP/DOWN so the panel translation animation starts
11291193
' in sync with the RowList floatingFocus animation rather than after it completes.
11301194
' Returns false so the RowList handles the actual navigation.

docs/components_home_FavoritesRows.bs.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,9 @@
338338
itemToPlay = getItemAtIndices(m.top.rowItemFocused)
339339
if isValid(itemToPlay) and itemToPlay.type <> "Loading"
340340
m.top.quickPlayNode = itemToPlay
341+
' Clear immediately — same pattern as selectedItem. Prevents stale
342+
' value from re-firing when the screen is restored after playback.
343+
m.top.quickPlayNode = invalid
341344
end if
342345
return true
343346
else if key = "replay"

docs/components_home_Home.bs.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,9 @@
297297
m.top.selectedItem = msg.getData()
298298
end sub
299299

300-
' Proxy quickPlayNode from whichever row list fires it
300+
' Proxy quickPlayNode from whichever row list fires it.
301+
' Must pass through invalid clears so Home.quickPlayNode doesn't retain
302+
' a stale value that re-fires the m.port observer on screen restoration.
301303
sub onQuickPlayNode(msg)
302304
m.top.quickPlayNode = msg.getData()
303305
end sub

docs/components_home_HomeRows.bs.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,19 @@
193193
if section.type = "resume"
194194
if m.isLoadingResume then continue for
195195
m.isLoadingResume = true
196+
m.LoadContinueWatchingTask.unobserveField("content")
196197
m.LoadContinueWatchingTask.observeField("content", "updateContinueWatchingItems")
197198
m.LoadContinueWatchingTask.control = "RUN"
198199
else if section.type = "nextup"
199200
if m.isLoadingNextUp then continue for
200201
m.isLoadingNextUp = true
202+
m.LoadNextUpTask.unobserveField("content")
201203
m.LoadNextUpTask.observeField("content", "updateNextUpItems")
202204
m.LoadNextUpTask.control = "RUN"
203205
else if section.type = "livetv"
204206
if m.isLoadingOnNow then continue for
205207
m.isLoadingOnNow = true
208+
m.LoadOnNowTask.unobserveField("content")
206209
m.LoadOnNowTask.observeField("content", "updateOnNowItems")
207210
m.LoadOnNowTask.control = "RUN"
208211
end if
@@ -783,6 +786,9 @@
783786
itemToPlay = getItemAtIndices(m.top.rowItemFocused)
784787
if isValid(itemToPlay) and itemToPlay.type <> "Loading"
785788
m.top.quickPlayNode = itemToPlay
789+
' Clear immediately — same pattern as selectedItem. Prevents stale
790+
' value from re-firing when the screen is restored after playback.
791+
m.top.quickPlayNode = invalid
786792
end if
787793
return true
788794
else if key = "replay"
@@ -805,6 +811,7 @@
805811
' Unobserve m.top fields
806812
m.top.unobserveField("rowItemSelected")
807813
m.top.unobserveField("rowItemFocused")
814+
m.top.unobserveField("programsExpired")
808815

809816
' Stop and release all persistent task nodes
810817
m.LoadLibrariesTask.unobserveField("content")

docs/components_search_SearchResults.bs.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
selectedItem = selectedContent.getChild(m.searchSelect.rowItemFocused[1])
170170
if isValid(selectedItem)
171171
m.top.quickPlayNode = selectedItem
172+
m.top.quickPlayNode = invalid
172173
return true
173174
end if
174175
end if

docs/components_ui_rowlist_JRRowList.bs.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
m.programProgressTimer = invalid
3838
m.observedContentRoot = invalid
3939
m.isProgramProgressTicking = false
40+
m.suppressNextExpiry = false
4041

4142
m.top.observeField("content", "onProgramProgressContentChanged")
4243
end sub
@@ -110,8 +111,13 @@
110111
m.isProgramProgressTicking = true
111112

112113
' Immediate refresh so returning from Settings/another screen does not
113-
' leave stale percentages on screen for up to 60 seconds.
114+
' leave stale percentages on screen for up to 60 seconds. Suppress expiry
115+
' detection on this first tick — the data is stale (from before the user
116+
' navigated away) and almost always contains expired programs, which would
117+
' trigger unnecessary refetches before the screen's own refresh has landed.
118+
m.suppressNextExpiry = true
114119
onProgramProgressTick()
120+
m.suppressNextExpiry = false
115121
end sub
116122

117123
sub stopProgramProgressTicking(releaseTimer = false as boolean)
@@ -192,7 +198,11 @@
192198
end for
193199

194200
if hasExpiredProgram
195-
m.top.programsExpired = true
201+
if m.suppressNextExpiry
202+
m.suppressNextExpiry = false
203+
else
204+
m.top.programsExpired = true
205+
end if
196206
end if
197207
end sub
198208

docs/data/search.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/module-ExtrasRowList.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)