Skip to content

fix(home): resolve missing library images in Multi-Server Libraries#505

Merged
RadicalMuffinMan merged 1 commit into
Moonfin-Client:mainfrom
mattsigal:bugfix/multi-server-library-images
Jun 12, 2026
Merged

fix(home): resolve missing library images in Multi-Server Libraries#505
RadicalMuffinMan merged 1 commit into
Moonfin-Client:mainfrom
mattsigal:bugfix/multi-server-library-images

Conversation

@mattsigal

Copy link
Copy Markdown
Contributor

Pull Request

Summary

This PR fixes a visual bug that occurs on the home screen "My Media" row when "Multi-Server Libraries" is enabled - library poster images failed to load, leaving library cards as blank gradient placeholders.

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

Data Model: Added a primaryImageAspectRatio field to the AggregatedLibrary model.
Repository Parsing: Updated user_views_repository.dart and multi_server_repository.dart to parse PrimaryImageAspectRatio from raw data and pass it to AggregatedLibrary.
Item Mapping: Modified getAggregatedLibraryTiles in multi_server_repository.dart to copy PrimaryImageAspectRatio to AggregatedItem's rawData map.
UI Logic: Adjusted the aspect ratio validation inside _resolveRowImageUrl in home_screen.dart from if (primaryAr == null || primaryAr >= 1.0) to if (primaryAr != null && primaryAr >= 1.0). This ensures that library items without a pre-computed aspect ratio returned by the server (which default to null on the /UserViews endpoint) can still resolve and render their poster art.

Platform

  • Android
  • iOS
  • 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):

Test Steps

  1. Navigate to Settings and toggle Multi-Server Libraries to On.
  2. Go back to the Home Screen and observe the My Media row.
  3. Verify that each library successfully renders its respective portrait poster image instead of fallback gradient cards.

Screenshots (if applicable)

Shield_Screenshot_2026-06-11_22-43-29 Shield_Screenshot_2026-06-11_22-43-39

Checklist

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

…lti-server My Media row

- Remove forced alphabetical sorting in getAggregatedLibraries to preserve the server-defined custom ordering.
- Add primaryImageAspectRatio to AggregatedLibrary and parse it from Jellyfin/Emby UserViews API.
- Update getAggregatedLibraryTiles to forward primaryImageAspectRatio to the home screen item.
- Modify the poster aspect ratio check on the home screen to permit library poster images when PrimaryImageAspectRatio is null.
Comment thread lib/data/repositories/multi_server_repository.dart
@mattsigal

mattsigal commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Just confirmed - the sorting removal is actually necessary because keeping it overrides the custom library order set on the server, which differs from the single-server behavior (keeping those lines puts them in alpha order). This should be good to merge.

@RadicalMuffinMan RadicalMuffinMan merged commit 492f361 into Moonfin-Client:main Jun 12, 2026
7 checks passed
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.

[UI] Custom Images for My Media Libraries do not load

2 participants