Merged
Conversation
…onization
This commit introduces a comprehensive download system for Audiobookshelf, allowing users to download audiobooks and podcast episodes for offline playback. It also adds a background synchronization mechanism to ensure progress made while offline is synced back to the server when a connection is re-established.
### Key Changes:
* **Offline Download System**:
* **Data Layer**: Added `AbsDownloadDao` and `AbsDownloadEntity` to track download status, progress, and local file paths.
* **Repository**: Implemented `AbsDownloadRepository` to manage the lifecycle of downloads (start, cancel, delete) and storage calculation.
* **Worker**: Introduced `AbsMediaDownloadWorker` to handle multi-track file downloads, cover art caching, and local playback session generation using `WorkManager`.
* **UI**: Added download actions to the `AudiobookshelfItemScreen` and integrated Audiobookshelf items into the `DownloadSettingsScreen`.
* **Progress Synchronization**:
* **Background Sync**: Added `AbsProgressSyncWorker` and `AbsProgressSyncScheduler` to batch-sync local playback progress to the server using the new `syncAllLocalSessions` API endpoint.
* **Offline Playback**: Updated `AudiobookshelfPlayer` and `AudiobookshelfProgressSyncer` to identify local sessions (prefixed with `local_`) and save progress to the local database when offline.
* **UI/UX Enhancements**:
* **Home Screen**: Introduced `DownloadedAudiobooksSection` and `DownloadedPodcastEpisodes` sections that appear specifically when the app is in offline mode.
* **Item Details**: Updated `AudiobookshelfItemScreen` to show download status indicators and allow filtering episodes by download status when offline.
* **Player Integration**: Refactored `AudiobookshelfPlaybackManager` to support loading cover art from local file URIs for downloaded content.
* **Database & Infrastructure**:
* **Migrations**: Added migrations 36 through 39 to support the `abs_downloads` table and additional metadata columns in `audiobookshelf_items`.
* **API Service**: Updated `AudiobookshelfApiService` with endpoints for batch session syncing and improved progress update handling.
* **Dependency Injection**: Updated `AudiobookshelfModule` to provide new DAOs and Repositories.
This commit introduces restrictions to the settings and server management screens when the application is in offline mode. By monitoring the offline state, the UI now prevents users from modifying server configurations or switching sessions when a connection is unavailable.
### Key Changes:
* **Settings Screen**:
* **`SettingsScreen.kt`**: Disabled the Jellyseerr and Audiobookshelf integration switches when `effectiveOfflineMode` is active.
* **Session Switching**: The "Switch Session" item is now non-clickable when the device is offline.
* **Server Management**:
* **`ServerManagementViewModel.kt`**: Integrated `OfflineModeManager` to expose an `isOffline` StateFlow, allowing the UI to react to connectivity changes.
* **`ServerManagementScreen.kt`**: Updated the "Add Server" Floating Action Button (FAB) to be visually disabled and non-functional when offline, using dimmed colors and conditional click logic.
This commit updates several core dependencies and build tools to their latest versions to ensure compatibility and leverage performance improvements.
### Key Changes:
* **Android Compose & Lifecycle**:
* Updated `activityCompose` to `1.13.0` and `composeBom` to `2026.03.01`.
* Updated `ui` to `1.10.6`.
* **Media3**:
* Bumped `media3` and its components (`media3ExoplayerHls`, `media3Session`) from `1.9.2` to `1.10.0`.
* **Data & Storage**:
* Updated `datastore` to `1.2.1`.
* Updated `paging` to `3.4.2`.
* **Architecture & Infrastructure**:
* Updated `work` (WorkManager) to `2.11.2`.
* Updated `tinkAndroid` to `1.21.0`.
* Updated `playServicesCastFramework` to `22.3.1`.
* **Tooling & Libraries**:
* Updated `ktfmt` to `0.26.0`.
* Updated `aboutlibrariesCore` to `14.0.0-b03`.
* Updated `composePagerIndicator` to `0.0.9`.
This commit introduces a new "Spotlight" feature to the home screen, featuring a high-visibility carousel for top-rated movies and series categorized by genre and studio. It also optimizes the home screen's data loading architecture to better handle concurrent resource fetching.
### Key Changes:
* **Spotlight UI Components**:
* **`SpotlightCarousel.kt`**: Created a new carousel component using `HorizontalMultiBrowseCarousel`. It features large backdrop imagery, gradient overlays, and dynamic support for media logos or text titles.
* **Interactive Elements**: Added IMDb and Rotten Tomatoes rating indicators and a direct "Play" action button on each spotlight card.
* **Responsive Layout**: Implemented orientation-aware sizing, adjusting card width and height for optimal display on both portrait and landscape devices.
* **Home Screen Integration**:
* **`HomeViewModel.kt`**: Added logic to fetch and interleave "Spotlight" sections (e.g., "Top Action Movies", "Best of Marvel Studios") into the home feed.
* **Positioning Logic**: Introduced `computeSpotlightPositions` to intelligently distribute spotlight carousels throughout the home feed rather than clustering them.
* **State Management**: Updated the `HomeSection` sealed class to include a `Spotlight` type and implemented deduplication logic to ensure items don't repeat across multiple carousels.
* **Data & Repository**:
* **`MediaRepository.kt`**: Added new interface methods `getTopRatedByGenre` and `getTopRatedByStudio`.
* **`JellyfinMediaRepository.kt`**: Implemented the new repository methods, querying the Jellyfin API for items filtered by genre or studio, sorted by community rating, and ensuring backdrop images are pre-fetched.
* **Performance & Lifecycle**:
* **Parallel Initialization**: Refactored `HomeViewModel` to use `coroutineScope` and `awaitAll` when loading studios, genres, and spotlights, significantly improving initial load times.
* **Session Resilience**: Enhanced the cleanup logic to reset spotlight-specific states when switching users or clearing data.
* **Code Quality**: Performed a general cleanup of indentation and formatting across `HomeScreen.kt` and `HomeViewModel.kt`.
…terial theme
This commit updates the base application theme to use the native Android Material light theme instead of the MaterialComponents library.
### Key Changes:
* **`themes.xml`**:
* Changed the parent theme of `Theme.AFinity` from `Theme.MaterialComponents.Light.NoActionBar` to `android:Theme.Material.Light.NoActionBar`.
* Updated the `colorPrimary` attribute to use the `android:` namespace.
* Removed the `colorBackgroundFloating` item.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.