Skip to content

Fixing Home Page Issues#390

Merged
RadicalMuffinMan merged 3 commits into
Moonfin-Client:mainfrom
mattsigal:bugfix/media-details-refinement
Jun 6, 2026
Merged

Fixing Home Page Issues#390
RadicalMuffinMan merged 3 commits into
Moonfin-Client:mainfrom
mattsigal:bugfix/media-details-refinement

Conversation

@mattsigal

Copy link
Copy Markdown
Contributor

Resolving Media Detail Page Discrepancies

Summary

This PR resolves metadata loading and play/resume state displays on show details pages, specifically for items navigated from or played via "Recent TV Shows", "Recent Movies", and "Continue Watching" rows. It addresses issue #388 by ensuring the details page correctly displays "Play" vs "Resume from SX:EX" and has the user-specific state needed to build the Next Up/resume episode queues.

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.

  • Updated getItem(itemId) to use the user-specific /Users/$userId/Items/$itemId endpoint instead of the public /Items/$itemId to load correct user-specific play and resume data.
  • Added RecursiveItemCount, ChildCount, and SpecialFeatureCount to kItemFields to determine the accurate played and episode counts for show/season context.
  • Added a fallback loop in getClientIfExists that normalizes base URLs to successfully look up client configurations by base URL when UUID lookups return null.
  • Tracked active stream resolver/play session client via _currentActiveResolverClient and registered/restored active resolvers and player services during playback configuration in _ensureResolverForItem.

Platform

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

Testing

  • Tested on emulator / simulator
  • Tested on physical device - tested on Android Mobile and Android TV
  • Manual testing completed
  • Not tested (explain why):

Test Steps

  1. Navigate to a show details page from the home row ("Recent TV Shows" or "Continue Watching").
  2. Verify that the details page displays "Play" (instead of "Resume from S1:E1") for new, never watched shows.
  3. Verify that the details page correctly displays the next unwatched episode (e.g., "Resume from S1:E4") for partially watched shows.
  4. Play an episode from the "Continue Watching" details page and verify that the next episode is queued properly.

Screenshots (if applicable)

N/A

Checklist

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

@mattsigal

Copy link
Copy Markdown
Contributor Author

Potentially related but currently unresolved issue - when playback is resumed from the Recent Movies or Recent Shows row (but not CW&NU) the play button doesn't seem to register properly. Flag for follow-up.

Comment thread lib/data/services/media_server_client_factory.dart Outdated
Comment thread lib/di/modules/playback_module.dart Outdated
Comment thread lib/di/modules/playback_module.dart
Comment thread lib/ui/screens/detail/item_detail_screen.dart
Comment thread lib/ui/screens/detail/item_detail_screen.dart
Comment thread packages/server_jellyfin/lib/src/api/jellyfin_item_fields.dart Outdated
mattsigal added 3 commits June 6, 2026 11:32
- Update ItemDetailViewModel to request UserData for season episodes.
- Fetch season episodes on-demand when starting an Episode playback if they are not already loaded in the view model, resolving missing queue/next button.
- Retrieve UserData field when loading Series episodes for queueing to resolve starting from 0:00.
- Correct totalEpisodes logic on Series items using recursiveItemCount instead of childCount to fix "Resume from S1E1" display on brand new series.
- Pass correct resume parameters in _maybeTriggerAutoPlay to auto-resume partially played items.
- Conditional play button labels on compact (mobile) layouts: display "Play" for unwatched S1E1, and "S$sE$e" code for episodes to avoid overflows.
…t Up, and Library Pages

- Updated `getItem` to load user-specific metadata from `/Users/$userId/Items/$itemId`
- Request `RecursiveItemCount`, `ChildCount`, and `SpecialFeatureCount` in default query fields to correctly identify fresh vs partially played series
- Add fallback base URL client lookup in `MediaServerClientFactory.getClientIfExists` for server ID base URLs
- Restore active stream resolver and playback control service bindings when switching between primary and secondary server play items
- Fixes Moonfin-Client#388 (resuming from Continue Watching failing to queue next up episodes)
- media_server_client_factory: guard URL-fallback loop with serverId.contains('://') so it only runs for URL-shaped inputs
- playback_module: restore safe early return in _ensureResolverForItem (drop ?? fallback, safer for multi-server)
- playback_module: add resetActiveStreamResolver() to clear cached client on logout
- session_repository: call resetActiveStreamResolver() in destroyCurrentSession()
- item_detail_screen: move s==1 && e==1 'Play' label above _isCompact branch (fixes TV/desktop)
- item_detail_screen: extract _computeWatchState() helper, replacing three copy-paste blocks
- jellyfin_item_fields: remove unused SpecialFeatureCount field
@mattsigal mattsigal force-pushed the bugfix/media-details-refinement branch from a59e1a7 to 6227637 Compare June 6, 2026 18:38
@mattsigal

Copy link
Copy Markdown
Contributor Author

All comments addressed!

@RadicalMuffinMan RadicalMuffinMan merged commit d1ce315 into Moonfin-Client:main Jun 6, 2026
6 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.

[Playback] Resuming episodes from "Continue Watching" on home page does not autoplay next EP and does not allow next ep navigation in player

2 participants