Skip to content

feat-ui - Deduplicate media items in Search and Home Rows and adjust Media Page visibility - #1056

Merged
RadicalMuffinMan merged 2 commits into
Moonfin-Client:mainfrom
mattsigal:feature/library-selector-visual-cleanup
Aug 6, 2026
Merged

feat-ui - Deduplicate media items in Search and Home Rows and adjust Media Page visibility#1056
RadicalMuffinMan merged 2 commits into
Moonfin-Client:mainfrom
mattsigal:feature/library-selector-visual-cleanup

Conversation

@mattsigal

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

Consolidate duplicate media items across libraries and multi-server sources into a single card per title across Search and Home Rows (also applies to Favorites, Playlists, Collections pages), add support for the DetailButton.server action button, and format Details screen Version selector options as [Library Name] - [Version Name] conditionally when multiple libraries exist for that content type.

Related Issues

Link related issues or tickets separated by commas.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • UI/UX update
  • Documentation update
  • Build/CI change
  • Other (describe):

Changes Made

List the key changes included in this PR.

  • media_deduplication_utils.dart: Created MediaDeduplicationUtils utility class providing canonical provider ID deduplication key generation, item merging favoring items with active playback progress/watch state, and conditional version label formatting ([Library Name] - [Version Name]) -- the Library string is only applied if the user has multiple libraries for that content type!
  • search_view_model.dart: Applied MediaDeduplicationUtils.deduplicateMediaItems across global and scoped search groups to eliminate duplicate cards.
  • multi_server_repository.dart: Applied item deduplication across Home Rows including Continue Watching (getAggregatedResume), Next Up (getAggregatedNextUp), Playlists (getAggregatedPlaylists), Favorites (getAggregatedFavorites), and Collections (getAggregatedCollections).
  • detail_buttons.dart: Added DetailButton.server to the action button layout enum, icon mappings (Icons.dns_rounded), and labels (using l10n.server localization).
  • item_detail_screen.dart: Updated _showVersionSelector to format version options with [Library Name] - [Version Name] whenever the user has more than 1 library for that media type.
  • media_deduplication_utils_test.dart: Unit test suite verifying deduplication key generation, item merging, and version formatting.

Platform

  • Android
  • iOS
  • tvOS
  • Web
  • macOS
  • Windows
  • Linux
  • All / Shared code

Testing

Describe how this change was tested.

  • Tested on emulator / simulator
  • Tested on physical device
  • Manual testing completed
  • Not tested (explain why): APK builds with no issues, however I do not have multiple libraries per type or use more than one server. Would be ideal to have someone with that set-up test. 3 unit tests were added (getDeduplicationKey, deduplicateMediaItems, and formatVersionLabel) and all passed.

Test Steps

  1. Perform search for multi-library/multi-version items (e.g., Avatar) to verify a single deduplicated card per title is displayed.
  2. Verify Continue Watching, Next Up, Playlists, Favorites, and Collections rows render 1 card per media item.
  3. Open the item details screen for a multi-library item and click Version to verify options display formatted as [Library Name] - [Version Name].
  4. Open the item details for a multi-server item and verify the Server button shows up and is populated with the appropriate servers.

Screenshots (if applicable)

Include screenshots or recordings for UI changes.

Checklist

  • Code builds successfully
  • Code follows project style and conventions
  • No unnecessary commented-out code
  • No new warnings introduced

…utton, and format Version labels with library names

- Consolidate duplicate media items across libraries and multi-server sources into 1 card per title in Search, Continue Watching, Next Up, Playlists, Favorites, and Collections.
- Add DetailButton.server to action buttons layout.
- Format Version selector labels as '[Library Name] - [Version Name]' conditionally when the user has multiple libraries for that content type.
@RadicalMuffinMan
RadicalMuffinMan merged commit d2d4cdb into Moonfin-Client:main Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants