Skip to content

Commit ef3e368

Browse files
oliv3rclaude
andcommitted
Fixed: Preserve insertion order for pinned and live items
Without SORT_METHOD_UNSORTED as default, Kodi sorts alphabetically. This reorders pinned items (search, explore pages) meant to stay at fixed positions and shuffles live channel listings out of EPG order. Make SORT_METHOD_UNSORTED the default sort method when any pinned or live items are present, matching the existing search behavior. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
1 parent 57b5bf9 commit ef3e368

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

resources/lib/actions/folderaction.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ def __add_sort_method_to_handle(self, handle, items=None):
311311
sort_methods.append(xbmcplugin.SORT_METHOD_EPISODE) # 24
312312

313313
is_search = self.parameter_parser.action == action.SEARCH
314-
if is_search:
314+
is_live = items and all(i.isLive for i in items if i.is_playable)
315+
has_pinned = items and any(i.dontGroup for i in items)
316+
if is_search or is_live or has_pinned:
315317
sort_methods.remove(xbmcplugin.SORT_METHOD_UNSORTED)
316318
sort_methods.insert(0, xbmcplugin.SORT_METHOD_UNSORTED)
317319

0 commit comments

Comments
 (0)