Fix: enhancement - custom sort home rows (#1) #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/1-custom-sort-home-rows"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
This PR implements configurable row ordering for home screen recommendation rows, addressing issue #1.
What was the issue
Users could not explicitly specify a custom sort order for the recommendation rows displayed on the home screen. Rows were ordered solely by their position in the config file list, with no way to control their display order independently.
What was changed
src/plex_middleware/config.py: Added an optionalorderfield toRecommendationRowSettings. The field accepts an integer orNone(default), allowing users to specify explicit sort positions.src/plex_middleware/recommendations.py: Updated_sorted_rows()to sort rows by their explicitordervalue (ascending). Rows without anordervalue fall back to the original config list order, ensuring backward compatibility.config.example.yml: Addedorderexamples for both Movie and TV recommendation sections.tests/test_recommendations.py: Added 5 new tests:test_sorted_rows_with_explicit_order- verifies rows are sorted by order valuestest_sorted_rows_without_explicit_order_preserves_list_position- verifies backward compatibilitytest_sorted_rows_mix_order_and_no_order- verifies mixed scenarios (ordered + unordered rows)test_order_field_is_optional_and_defaults_to_none- verifies the field is optionaltest_reconciliation_uses_explicit_order_for_moves- verifies end-to-end reconciliation with orderingHow to use
Add an
orderfield to any recommendation row in your config file:Lower
ordervalues appear first. Rows withoutordermaintain their original config position after all ordered rows.Verification
Run the test suite:
All 10 tests pass, including the 5 new tests for ordering behavior.
Pull request closed