Commit Graph

148 Commits

Author SHA1 Message Date
86f44ac9ce refactor(data): deduplicate concurrent data fetches with SingleFlight 2026-06-22 17:26:50 +00:00
6e48b35741 refactor(data/jellyfin): reload media items on user data change events 2026-06-20 16:01:22 +00:00
8a2702a7cb refactor(core/series): improve data loading reliability with concurrent initialization 2026-06-20 12:18:29 +00:00
5a98f3d2e7 refactor(core): separate data loading from repository reads
Move implicit loading side effects out of getX methods into explicit loadX methods, making data flow predictable. Remove seriesTitle StateFlow in favor of direct seriesName access. Add proper error handling to repository load operations.
2026-06-20 09:27:25 +00:00
1ec9ff9c95 perf(home): head-fetch rows and count-only libraries
Add a head-only fetch path for the home rows (Suggestions, Continue
Watching, Next Up, Latest per library). The first HEAD_LIMIT items
are fetched first; if the head matches the cached head, the full
request is skipped. Most home refreshes now only pay for the small
head request, not the full payload.

Replace per-library getLibraryContent calls in the home page with
getLibraryItemCount (limit=0, enableTotalRecordCount=true). The home
page only uses Library.size; the full movies/series lists are fetched
on demand by LibraryViewModel via the new loadLibraryContent method.
The per-row loaders now upsert full movie/series details into
onlineMediaRepository so the home viewmodel can still resolve them.
2026-06-19 13:46:21 +00:00
5491c381a3 feat(jellyfin): add ETag-based conditional HTTP caching for home refresh
Introduce an OkHttp interceptor that caches ETags from home-refresh
endpoints and throws NotModifiedException on 304, allowing callers to
reuse cached data. Wire it into the Jellyfin SDK via a dedicated
@JellyfinSdkClient OkHttpClient. Update API methods to return null on
304, and update InMemoryAppContentRepository to keep existing state
when null is returned. Persist dateLastMediaAdded from /UserViews in
HomeCache to short-circuit unchanged /Items/Latest calls.
2026-06-19 13:16:07 +00:00
f6c465656e perf(home): reduce redundant requests on home refresh
Drop a duplicate getLibraries call from loadLatestLibraryContent by
reusing the libraries already loaded earlier in the same refresh.

Add a 30s debounce to HomeRefreshCoordinator.onResumed so rapid
resume/tab-switch events coalesce into a single refresh; pull-to-refresh
bypasses the gate via onRefresh.

Rate-limit SyncPlaybackPositionsHomeRefreshSideEffect to once every
6h with a 25-item cap and a rotating window cursor, so users with many
downloads no longer fire one getItemInfo call per item on every resume.
2026-06-19 14:38:57 +02:00
54c895ff0f feat(player): track skippable segment type to gate intro and outro UI
Expose the active skippable segment type from the player state so the UI
can show the skip intro button only for intro segments and trigger the
next episode overlay when an outro segment is active.
2026-06-19 14:25:29 +02:00
1bd51d8a9f refactor(player): move controls auto-hide from ViewModel to composable layer 2026-06-18 20:05:35 +00:00
615e95db5c feat(player): add next episode overlay that appears 20s before episode end
Show an "Up Next" card with the next episode thumbnail, play overlay,
and title when within 20 seconds of the current episode ending.
Tapping it immediately starts the next episode from the playlist queue.

- Add nextEpisode field to PlayerUiState derived from queue
- Create NextEpisodeOverlay for mobile with artwork + title
- Create TvNextEpisodeOverlay for TV with D-pad focus support
- Integrate into both PlayerScreen and TvPlayerScreen
- Auto-focus overlay on TV when it appears
2026-06-18 16:34:39 +00:00
8d74d0c5df refactor(media): remove LocalMediaUpdater interface in favor of MediaMetadataUpdater
Make LocalMediaRepository extend MediaMetadataUpdater directly instead of the
now-removed LocalMediaUpdater, eliminating the redundant intermediate interface.
Add no-op updatePlaybackPosition stubs to all LocalMediaRepository implementations
since server-side position tracking belongs in the remote layer of the composite.

JellyfinMediaMetadataUpdaterImpl continues to act as the composite that combines
LocalMediaRepository (local cache) with JellyfinApiClient (remote server) under
the single MediaMetadataUpdater contract.
2026-06-12 18:40:22 +00:00
e78a3700a6 refactor(media): consolidate metadata update functions into MediaMetadataUpdater
Replace the disparate JellyfinMediaMetadataUpdater, LocalMediaUpdater,
and direct API/repository calls for watched status and progress updates
with a single unified MediaMetadataUpdater interface and implementation.

The new implementation coordinates both local cache (in-memory/Room)
and remote server updates, so callers have a single point of entry
for all metadata mutations. markAsWatched now updates both server
and local state, fixing a gap where the UI would not reflect
watched changes until a full refresh.
2026-06-12 18:08:32 +00:00
def92ad111 feat(ui): add watched toggle to detail screens and home/library cards
Add mark-as-watched/unwatched bottom sheet actions to home screen
NextUp cards and library browse cards, and to library screen grid items.
Add a single-button watched toggle (with dual icon/color states) to
Movie, Episode, and Series detail screens. Inject
JellyfinMediaMetadataUpdater into all four affected ViewModels.
2026-06-12 17:47:14 +00:00
4727cdcab1 refactor(offline): rename OfflineCatalogStore to OfflineMediaManager and consolidate into repository
- Rename interface OfflineCatalogStore → OfflineMediaManager for clarity

- Merge RoomOfflineCatalogStore functionality into OfflineLocalMediaRepository

- Remove RoomOfflineCatalogStore; update DI binding and consumers
2026-06-12 16:11:34 +00:00
2853609cbb chore: remove unused interface 2026-06-12 17:53:15 +02:00
4a6977eefb feat(connectivity): add offline resilience with server reachability checks 2026-06-07 11:25:59 +00:00
85c53f8704 feat(playback): sync offline positions with Jellyfin
Add a home refresh side effect that compares offline progress with Jellyfin user data and syncs the furthest playback position.

Use Jellyfin playbackPositionTicks for server updates while keeping percent-based writes for local offline and in-memory repositories.
2026-06-05 14:57:20 +00:00
9f8292b04d refactor(home): extract refresh side effects
Centralize home refresh orchestration so future refresh side effects can be added through Hilt multibindings instead of expanding AppViewModel.
2026-06-04 19:26:47 +00:00
0011f3842a refactor(playback): simplify transcoding fallback state 2026-06-01 19:37:04 +00:00
38f1f94956 fix(playback): fall back to transcoding on direct play errors 2026-06-01 21:25:21 +02:00
80ab591662 Simplify Jellyfin playback url retrieval 2026-06-01 20:54:20 +02:00
b1b154800c Code cleanup 2026-06-01 20:02:27 +02:00
1dedc7ff0a Revert "feat(network): enhance connectivity monitoring with request reporting"
This reverts commit 56a2b42434.
2026-05-25 17:59:01 +02:00
b226eaeba2 feat(downloads): update downloaded item handling 2026-05-23 18:45:27 +00:00
Purefin Dev
645e28ab30 feat(settings): add per-library visibility toggles for home screen
Add a Home Screen Libraries setting group with per-library toggles to control which libraries appear on the home screen. Libraries toggled off are hidden from both phone and TV home screens but remain accessible via the Libraries tab and navigation drawer.
2026-05-21 19:38:15 +00:00
56a2b42434 feat(network): enhance connectivity monitoring with request reporting 2026-05-20 17:07:32 +02:00
1fc2c8cf05 feat(logging): improve uncaught exception handling with dedicated logging method 2026-05-14 18:24:56 +02:00
c70657e627 feat(logging): enhance log entry handling with truncation and improve upload file naming 2026-05-14 18:23:21 +02:00
4b87f93dee Add Timber file logging and Jellyfin log upload 2026-05-14 18:06:54 +02:00
6cff6be238 feat: enhance media playback handling with offline support and download metadata integration 2026-05-14 14:38:24 +02:00
a0a51ef436 feat: add smart download management with enable and delete options 2026-05-14 14:09:35 +02:00
f60aba5a72 feat: update media selection logic to handle offline state in view models and DTOs 2026-05-14 12:56:48 +02:00
83730188eb feat: add online status handling to navigation and UI components 2026-05-14 12:39:20 +02:00
cc643ae34f feat: add preferenceMediaId to PlayableMedia and update related logic to make more prone to mistakes 2026-05-13 22:53:27 +02:00
8950a37341 feat: update app to check for updates on app open 2026-05-13 22:22:53 +02:00
7ec9a0f41f feat: implement logout functionality and settings provider 2026-05-13 22:17:50 +02:00
d3b66d4fc5 feat: redesign login screen on both app and app-tv 2026-05-13 21:59:23 +02:00
beae723372 feat: add ReadOnlySetting and corresponding UI component for displaying read-only settings 2026-05-13 19:31:58 +02:00
3ee4b558f5 Make media detail flows reactive 2026-05-13 16:43:42 +02:00
26a134869e feat(settings): update settings items to handle null values for improved stability 2026-05-08 22:35:36 +02:00
80f5454afb feat(settings): add app update settings action 2026-05-08 22:29:07 +02:00
60d2a1eb2a feat: trigger refresh on home navigation in TvAppScreen for improved data consistency 2026-05-08 20:26:26 +02:00
af2e8b0dc9 feat: enhance settings screen with dropdown and void setting options for improved user experience 2026-05-08 20:19:05 +02:00
4788eec102 feat: add SeriesIdLookUpUseCase for episode to series ID mapping and update track preference saving logic 2026-05-08 19:30:44 +02:00
9d7c166bc8 feat: refactor SeriesScreen and ViewModel for improved season episode loading and download handling 2026-05-08 18:47:15 +02:00
56fe574940 feat: add watched status to MediaUiModel 2026-05-07 19:45:09 +02:00
f75f18d2af refactor: restructure SettingsRepository and implement SettingsRepositoryImpl 2026-05-06 17:36:34 +02:00
322eb69ab5 refactor: update package structure to use core namespace 2026-05-06 17:24:04 +02:00
ca3e5dfdf5 delete: Remove genre loading and storage from LocalMediaRepository 2026-05-04 18:17:51 +02:00
bc4b26291f refactor: MediaProgressWriter to LocalMediaUpdater and add markAsWatched support 2026-05-04 18:15:29 +02:00