Commit b38fcb0
committed
This commit introduces major database optimizations and UI performance improvements, primarily focusing on search efficiency through FTS4 and reducing recomposition overhead in the player.
### Database & Search
- **FTS4 Search Integration:** Added `songs_fts` virtual table and Room triggers to provide indexed full-text search for song titles and artist names. Replaced `LIKE` queries with `MATCH` for significantly faster search performance.
- **Source Type Indexing:** Introduced a `source_type` column (Local, Telegram, GDrive, etc.) to the `songs` table to replace expensive URI scheme string checks in repository and DAO queries.
- **Schema Migrations:** Added migrations (34→35, 35→36) to handle the new `source_type` column and initialize the FTS4 search table.
### Performance & Optimization
- **Player State Consolidation:** Refactored `PlayerViewModel` to consolidate multiple infrequent preference flows into a single `player_config_slice`. This prevents excessive recompositions in the `UnifiedPlayerSheet` when individual settings change.
- **Lazy List Improvements:** Added `contentType` and explicit `key` parameters to several lazy lists (Library, Search, Recently Played) to improve scroll performance and item recycling.
- **Deferred Rendering:** Optimized screen transitions for Album, Artist, and Genre detail screens by reducing delays and tuning heavy list population.
- **SmartImage Sizing:** Implemented `targetSize` hints for `SmartImage` in list contexts to optimize memory usage and image loading.
- **Cached Filtering:** Implemented a cached directory filter in `MusicRepositoryImpl` that recomputes only when directory preferences change.
### Features & Bug Fixes
- **Lyrics Import Security:** Refactored lyrics file validation into a more robust, asynchronous utility with improved error handling and security checks.
- **Theme Generation:** Enhanced `ThemeStateHolder` with a request-based generation mechanism and "eager" loading options to improve color scheme availability for album art.
- **MediaStore Search:** Optimized `MediaStoreSongRepository` to fetch multiple user preferences concurrently during search operations.1 parent 3b4bcfd commit b38fcb0
31 files changed
Lines changed: 5441 additions & 333 deletions
File tree
- app
- schemas/com.theveloper.pixelplay.data.database.PixelPlayDatabase
- src
- androidTest/java/com/theveloper/pixelplay/data
- database
- worker
- main/java/com/theveloper/pixelplay
- data
- database
- gdrive
- qqmusic
- repository
- worker
- di
- presentation
- components
- player
- subcomps
- screens
- viewmodel
Lines changed: 2397 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 2433 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
Lines changed: 31 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
81 | 103 | | |
82 | 104 | | |
83 | 105 | | |
84 | | - | |
| 106 | + | |
85 | 107 | | |
86 | 108 | | |
87 | 109 | | |
88 | 110 | | |
| 111 | + | |
89 | 112 | | |
90 | 113 | | |
91 | 114 | | |
| |||
96 | 119 | | |
97 | 120 | | |
98 | 121 | | |
99 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
100 | 125 | | |
101 | 126 | | |
102 | 127 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
0 commit comments