Skip to content

Consolidated community contributions: AI architecture overhaul, tablet optimization, localization (ja/ar/pt-BR/fr), customizable library tabs, playlist concurrency fix, UI improvements, security hardening, and code quality pass#2404

Open
daedaevibin wants to merge 108 commits into
PixelPlayerHQ:masterfrom
Veridian-Zenith:master

Conversation

@daedaevibin

Copy link
Copy Markdown
Contributor

To place everything into one place, along with other improvements and work, I have merged all the pending PRs into my own fork and I am working currently to resolve conflicts.

rebornlokii and others added 30 commits June 13, 2026 09:39
Updated Italian strings in changelogs for improved clarity and consistency.
…anguage enum and remove legacy translation keys
Add widthIn(max = 540.dp) to dialogs and several setup pages to constrain content on wide screens and import required layout helpers. Rename the SineWaveLine parameter from `waves` to `wavesDensity`, update its KDoc and default, and adjust the theta calculation to scale density relative to a 380dp baseline width. Update all call sites (BetaInfoBottomSheet, ChangelogBottomSheet, PlaylistContainer, SetupScreen, etc.) to use `wavesDensity`. Also small UI tweaks in SetupScreen: comment out CenterHorizontally alignment, reduce a spacer height, and set the welcome artwork to requiredWidth(380.dp). These changes improve responsive layout behavior and make the sine wave drawing density consistent across different widths.
still working on the min width
and the back animation
Renamed the central AI orchestration class from AiOrchestrator to AiHandler
and updated all references across the codebase.
…s all providers

- Create UnifiedModelFilter utility that filters out embedding, image, TTS,
  speech, moderation, vision-only, and other non-chat models
- Update GeminiAiClient to use UnifiedModelFilter instead of hardcoded markers
- Update GenericOpenAiClient to use UnifiedModelFilter instead of inline filter
These providers all use OpenAI-compatible APIs. Switching from dedicated
client classes to GenericOpenAiClient eliminates duplicate code. The old
class files are kept on disk but no longer referenced.
Add CUSTOM provider with hasConfigurableUrl=true and requiresApiKey=true
for user-configured self-hosted/custom API endpoints.
CUSTOM provider uses GenericOpenAiClient with an empty default URL (user
configures it via settings). createClientWithUrl allows creating a client
with a custom base URL for configurable-URL providers.
AmrEldeeb5 and others added 24 commits June 18, 2026 22:15
…urrently

PlaylistPreferencesRepository edited playlists with an unsynchronized
read-modify-write: userPlaylistsFlow.first() -> modify list -> updatePlaylist().
Removing several songs in quick succession fired concurrent coroutines that each
read the same snapshot, so the last write won and the other removals were
silently dropped. The Playlists-menu song count (songIds.size, read from the DB)
then stayed stuck high, while the playlist detail screen still looked correct
because it updates optimistically per tap.

Serialize the read-modify-write editors (add/remove/reorder/rename/updatePlaylist
/removeSongFromAllPlaylists) behind a coroutine Mutex so each edit reads and
writes atomically. A private updatePlaylistLocked avoids re-entrant locking.

Add an instrumentation regression test covering sequential add/remove, the
concurrent-removal race, and the exact issue PixelPlayerHQ#2391 reproduction (fails before
this change, passes after).

Fixes PixelPlayerHQ#2391
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 6 to 7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the gradle-dependencies group with 1 update: [com.google.genai:google-genai](https://github.com/googleapis/java-genai).


Updates `com.google.genai:google-genai` from 1.58.0 to 1.59.0
- [Release notes](https://github.com/googleapis/java-genai/releases)
- [Changelog](https://github.com/googleapis/java-genai/blob/main/CHANGELOG.md)
- [Commits](googleapis/java-genai@v1.58.0...v1.59.0)

---
updated-dependencies:
- dependency-name: com.google.genai:google-genai
  dependency-version: 1.59.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: gradle-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Security:
- Fix OkHttp response body leaks in AI clients by using .use{} blocks
- All HTTP responses now properly closed in OpenAiCompatibleClient base

Error handling:
- Add Timber logging to silent catch blocks in EqualizerPreferencesRepository,
  PlaylistViewModel, LyricsStateHolder, FileExplorerStateHolder,
  DeviceCapabilitiesViewModel, PhoneDirectWatchTransferCoordinator

Refactoring:
- Extract OpenAiCompatibleClient base class from DeepSeek, Groq, Mistral,
  GenericOpenAi clients (~600 lines of duplicated code removed)
- Extract ServerUrlUtils for shared URL normalization/validation logic
  used by NavidromeCredentials and JellyfinCredentials

Tests:
- Add AiClientFactoryTest (all providers, blank key validation)
- Add OpenAiCompatibleClientTest (config, model filtering, token counting)
- Add CloudMusicUtilsTest (JSON parsing, artist name parsing)
- Add ServerUrlUtilsTest (URL normalization, validation, local network checks)

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The abstract val 'defaultModel' generated a getDefaultModel() JVM getter
that clashed with the AiClient interface's getDefaultModel() function.
Renamed to 'providerDefaultModel' and 'providerDefaultModels' to avoid
the accidental override.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…/github-actions-640176b5ab

chore(deps): bump actions/checkout from 6 to 7 in the github-actions group
…dependencies-8a53d774ef

chore(deps): bump com.google.genai:google-genai from 1.58.0 to 1.59.0 in the gradle-dependencies group
Security:
- Fix OkHttp response body leaks in GDriveApiService (4 methods)
- Fix JSON injection in GDriveApiService.createFolder — use JSONObject
  builder instead of string interpolation
- Harden GDriveApiService.getAuthHeader to require a token instead of
  silently sending 'Bearer ' with empty token

Performance:
- Cache 6 Regex patterns in LyricsRepositoryImpl companion object that
  were recompiled on every call to normalizeForMatch/timingVariantTokens/
  looksLikeFlattenedWordByWordCache

Thread safety:
- Add @volatile to GDriveStreamProxy's server, actualPort, startJob
  fields accessed from multiple threads

Error handling:
- Add Timber.w logging to 12 more silent catch blocks across backup
  (BackupManager, BackupWriter, BackupHistoryRepository, LegacyPayloadAdapter),
  database (PixelPlayDatabase migrations, SongEntity),
  network (NeteaseApiService, QQSignGenerator, QqMusicRepository),
  presentation (ThemeStateHolder, SongRemovalStateHolder),
  and utils (MediaMetadataRetrieverPool)

Code quality:
- Remove dead try/catch in ChangelogBottomSheet.openUrl that caught and
  redid the exact same operation
- Make filterModels internal for testability

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Security:
- Update Netty constraint from non-existent 4.2.28.Final to latest
  actual release 4.2.15.Final to address Dependabot alerts #36, #37, #38

Bug fix:
- Fix AbsoluteSmoothCornerShape parameter ordering in
  NavBarCornerRadiusScreen non-full-width preview — smoothness params
  were misaligned with their corner radius params

Code quality:
- Sort imports alphabetically in GenreCategoriesGrid; add explicit
  imports for FilledIconButton, Icon, IconButtonDefaults to replace
  inline FQN usage
- Translate all Spanish comments to English in SongEntity,
  PlaylistViewModel, OtherShapes, GenreCategoriesGrid

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…-errorhandling-refactor-tests

Security hardening, error handling, AI client refactoring, and test coverage
…overhaul, new providers, and generation tuning
…lation and configure app languages

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…sing telegram channel topics and About screen buttons

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…aylist edits from concurrent song removals
…layerHQ#2371

PR #41 refactored AI clients into OpenAiCompatibleClient base class.
Upstream PixelPlayerHQ#2371 deleted separate clients entirely, unified into
GenericOpenAiClient. Resolution: accept PixelPlayerHQ#2371's deletions, remove
now-dead OpenAiCompatibleClient and its test, update AiClientFactoryTest
to match new architecture.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@daedaevibin daedaevibin marked this pull request as draft June 19, 2026 03:03
daedaevibin and others added 2 commits June 19, 2026 03:04
…convention

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ated-upstream-prs

Consolidated upstream PRs: AI overhaul, tablet support, localization (ja/ar/pt-BR/fr), tab management, playlist fix, UI fixes, deps bump
@daedaevibin

Copy link
Copy Markdown
Contributor Author

Summary

Brings together 12 community PRs, security hardening, error observability, code deduplication, performance optimizations, and test coverage across 169 files (7,980 insertions, 4,032 deletions).


Community PRs Consolidated

Upstream PR Title Author
#2400 fix(playlists): prevent lost playlist edits from concurrent song removals AmrEldeeb5
#2397 chore(deps): bump com.google.genai:google-genai 1.58.0 → 1.59.0 dependabot
#2396 Feature/localization ja (Japanese) fujimon0722
#2383 ui: fix layout jump when collapsing telegram channel topics + Telegram/GitHub buttons in About Ayaanh001
#2380 feat: Add complete Arabic translation and configure app languages Hisham-Alzamzami
#2373 feat(removing library tabs): implement customizable tab management (add/remove) Ayaanh001
#2371 feat(ai): massive architecture overhaul, new providers, and generation tuning VoidX3D
#2363 Feat: tablet optimization ZL114514
#2355 feat(i18n): add pt-BR localization retrozinndev
#2353 Update French lyrics mode strings for consistency rebornlokii
#2352 Restructure Arabic localization resources and change AppLanguage behaviour adlifarizi
#2347 Update Strings to show beta 7.5 rebornlokii

AI Architecture Overhaul (#2371)

  • Renamed AiOrchestratorAiHandler; removed per-provider clients (DeepSeekAiClient, GroqAiClient, MistralAiClient) — all OpenAI-compatible providers now use GenericOpenAiClient with per-provider config in AiClientFactory.
  • Added AiResponseCleaner for robust response parsing, UnifiedModelFilter for chat model filtering, and new providers (Ollama, Custom with configurable base URL).
  • AiSystemPromptEngine overhauled with chain-of-thought prompting, few-shot examples, and quality guardrails.
  • GenericOpenAiClient.ChatRequest extended with topP, topK, maxTokens, presencePenalty, frequencyPenalty — all configurable from AiPreferencesRepository.
  • New UI: SearchableModelSelector, generation parameter sections, and song data configuration in AI settings.

Tablet Optimization (#2363)

  • Adaptive HomeScreen layout with PlayerInternalNavigationBar for landscape/tablet form factors.
  • PlayerSheetPredictiveBackHandler and SineWaveLine adjustments for larger screens.

Localization

Customizable Library Tabs (#2373)

  • ReorderTabsSheet extended with add/remove functionality for library tabs.
  • Persistent tab configuration stored in UserPreferencesRepository.
  • PlayerViewModel handles saving and resetting tab orders; LibraryScreen dynamically renders based on user preferences.

Playlist Concurrency Fix (#2400)

  • PlaylistPreferencesRepository prevents lost edits from concurrent song removals.
  • New PlaylistSongCountTest androidTest for verification.

UI Improvements (#2383)

  • Fixed layout jump when collapsing Telegram channel topics in TelegramDashboardScreen.
  • Added GitHub and Telegram social chips to AboutScreen with localized strings across all supported languages.

Security Hardening

  • OkHttp response body leaks: All AI client and GDrive API HTTP calls wrapped with response.use {} to prevent connection leaks on error paths.
  • JSON injection: GDriveApiService.createFolder now uses JSONObject builder instead of string interpolation.
  • Empty auth header: GDriveApiService.getAuthHeader() fails fast via require() instead of silently sending "Bearer ".
  • Netty dependency: Updated constraint from non-existent 4.2.28.Final to latest actual release 4.2.15.Final (addresses CVE-2025-48625, CVE-2023-44487, CVE-2025-24970).
  • Thread safety: Added @Volatile to GDriveStreamProxy.server, actualPort, startJob.

Code Quality

  • Refactoring: Extracted ServerUrlUtils for URL normalization shared between NavidromeCredentials and JellyfinCredentials.
  • Performance: Cached 6 Regex patterns in LyricsRepositoryImpl companion object that were recompiled per-call.
  • Error handling: Added Timber.w() logging to 20+ silent catch blocks across backup, database, network, presentation, service, and utility layers. Removed dead try/catch in ChangelogBottomSheet.openUrl.
  • Bug fix: Fixed AbsoluteSmoothCornerShape parameter ordering in NavBarCornerRadiusScreen — smoothness params were misaligned with corner radii.
  • Import ordering: Sorted imports alphabetically in GenreCategoriesGrid; replaced inline FQN usage with explicit imports.
  • Spanish comments: Translated all Spanish comments to English across SongEntity, PlaylistViewModel, OtherShapes, GenreCategoriesGrid.

Tests

  • AiClientFactoryTest — verifies all providers create correct client types and reject blank API keys.
  • CloudMusicUtilsTest — tests for cloud music utility functions.
  • ServerUrlUtilsTest — tests for URL normalization/validation.
  • PlaylistSongCountTest — androidTest for playlist concurrent edit protection.

Dependency Updates

  • com.google.genai:google-genai 1.58.0 → 1.59.0
  • actions/checkout bumped in CI workflows
  • Gradle dependencies group update

Conflict Resolution Notes

@daedaevibin daedaevibin changed the title Consolidated PR merge Consolidated community contributions: AI architecture overhaul, tablet optimization, localization (ja/ar/pt-BR/fr), customizable library tabs, playlist concurrency fix, UI improvements, security hardening, and code quality pass Jun 19, 2026
@daedaevibin daedaevibin marked this pull request as ready for review June 19, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants