Refactor AI integration and data management to improve system reliabi…#1695
Merged
Conversation
…lity and expand configuration options. ### AI & LLM Integration - **Expanded Provider Support**: Added configuration states for DeepSeek, NVIDIA, Kimi, and GLM models in `SettingsViewModel`. - **Digest Generation**: Updated `UserProfileDigestGenerator` to use a more comprehensive "All" time range and replaced raw skip ratios with active session cadence (sessions per day) for richer behavioral context. - **Worker Enhancements**: Updated `AiWorker` and `GeminiModelService` to properly convert database entities to domain models when generating user digests. - **State Management**: Streamlined `PlayerViewModel` logic by consolidating AI-related state updates and refactoring the AI provider availability check to handle multiple API keys more efficiently. ### Database & Schema - **Jellyfin Integration**: Added schema definitions and migration logic for `jellyfin_songs` and `jellyfin_playlists` tables, including relevant indices for optimized querying. - **AI Caching**: Introduced an `ai_cache` table to store prompt hashes and responses, reducing redundant LLM API calls. - **Migration Cleanup**: Consolidated recent database migrations into the main creation logic for cleaner schema initialization. ### UI & Components - **Settings & Playlists**: Added DeepSeek API key visibility to the settings screen and updated the AI Playlist and Metadata sheets with improved visual feedback (animations, icons, and layout refinements). - **Bug Fixes**: Resolved minor UI state synchronization issues between `AiStateHolder` and the player interface. ### Performance & Architecture - **Dependency Cleanup**: Removed unused `EngagementDao` dependency from the AI digest generator. - **Resilience**: Improved error handling in the song editing flow and ensured background workers have access to the full song library for generating context-aware summaries.
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.
…lity and expand configuration options.
AI & LLM Integration
SettingsViewModel.UserProfileDigestGeneratorto use a more comprehensive "All" time range and replaced raw skip ratios with active session cadence (sessions per day) for richer behavioral context.AiWorkerandGeminiModelServiceto properly convert database entities to domain models when generating user digests.PlayerViewModellogic by consolidating AI-related state updates and refactoring the AI provider availability check to handle multiple API keys more efficiently.Database & Schema
jellyfin_songsandjellyfin_playliststables, including relevant indices for optimized querying.ai_cachetable to store prompt hashes and responses, reducing redundant LLM API calls.UI & Components
AiStateHolderand the player interface.Performance & Architecture
EngagementDaodependency from the AI digest generator.