Skip to content

Fixed: Preserve insertion order for pinned and live items#1940

Open
oliv3r wants to merge 1 commit intoretrospect-addon:masterfrom
oliv3r:preserver_order
Open

Fixed: Preserve insertion order for pinned and live items#1940
oliv3r wants to merge 1 commit intoretrospect-addon:masterfrom
oliv3r:preserver_order

Conversation

@oliv3r
Copy link
Contributor

@oliv3r oliv3r commented Mar 5, 2026

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.

@oliv3r oliv3r force-pushed the preserver_order branch 2 times, most recently from ef3e368 to 81fc97b Compare March 9, 2026 07:00
is_search = self.parameter_parser.action == action.SEARCH
if is_search:
is_live = items and all(i.isLive for i in items if i.is_playable)
has_pinned = items and any(i.dontGroup for i in items)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dontGroup is not something that pins items. It just makes them not group if grouping is configured. So the is no reason to do this check. There is no real option to pin items to the top in Kodi or exclude them from sorting. I usually prepend \a or \b for items I want that the top.

The live items do make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, sorry; this should fix it.

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>
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants