SpotiFLAC-Mobile/lib/services
zarzet 01a5b43613 perf: unify queue tab with DB-backed pagination and cross-database queries
Replace in-memory list merging in the queue tab with fully database-
backed pagination using ATTACH DATABASE to join library and history
tables in a single UNION ALL query.

Queue tab:
- Remove localLibraryAllItemsProvider and _queueHistoryStatsProvider
- Add _queueLibraryPageProvider and _queueLibraryCountsProvider backed
  by LibraryDatabase.getQueueTrackPage/getQueueCounts/getQueueAlbumPage
- Implement infinite scroll via _handleLibraryScrollNotification with
  _libraryPageLimit growing by 300 per batch
- Album/single/total counts computed via SQL GROUP BY aggregates

History database (v5 -> v8):
- v6: add idx_history_track_artist index
- v7: add history_path_keys table for cross-DB dedup, backfill from
  existing rows
- v8: add spotify_id_norm, isrc_norm, match_key normalized columns
  with indexes, backfill from existing data
- Add getAlbumTracks, findByTrackAndArtist, getGroupedCounts,
  existsTrack, findExistingTrack, existingTrackKeys batch lookup
- deleteBySpotifyId now returns deleted count for accurate totalCount
- All write paths maintain history_path_keys consistency

Library database (v7 -> v8):
- v8: add library_path_keys table for cross-DB dedup
- Add getQueueTrackPage, getQueueCounts, getQueueAlbumPage with
  ATTACH DATABASE for cross-DB UNION ALL queries
- Dedup local items against history via path_keys JOIN
- All write/delete paths maintain library_path_keys consistency

Download history provider:
- Load only 100 recent items into state.items at startup
- Store lookupItems as immutable List field instead of recomputing
  from maps on every access
- Add async fallback to DB in _putInMemoryHistory for items outside
  the 100-item window
- Add downloadHistoryPageProvider, downloadHistoryGroupedCountsProvider,
  downloadedAlbumTracksProvider, downloadHistoryBatchExistsProvider
- Add catchError to adoptNativeHistoryItem async block
- Fix removeBySpotifyId to query actual DB count instead of decrement

Screen migrations:
- album/artist/playlist/home screens use async DB lookups instead of
  sync in-memory state for track existence and playback resolution
- downloaded_album_screen uses downloadedAlbumTracksProvider
- library_tracks_folder_screen uses downloadHistoryBatchExistsProvider
  for skip-downloaded checks and cover resolution
2026-05-06 04:38:51 +07:00
..
apk_downloader.dart refactor: code cleanup and improvements 2026-01-17 09:07:29 +07:00
app_state_database.dart refactor: enable strict analysis options and fix type safety across codebase 2026-03-27 19:28:42 +07:00
cover_cache_manager.dart feat: add resolve API with SongLink fallback, fix multi-artist tags (#288), and cleanup 2026-04-13 23:32:14 +07:00
csv_import_service.dart chore: update app dependency versions 2026-05-03 01:25:26 +07:00
download_request_payload.dart perf: optimize native worker snapshot writes with delta mode 2026-05-05 03:17:38 +07:00
downloaded_embedded_cover_resolver.dart perf: incremental download queue lookup updates, async cover cleanup, and native JSON decoding on iOS 2026-04-13 23:32:16 +07:00
ffmpeg_service.dart chore: remove redundant comments and boilerplate across codebase 2026-05-05 21:35:18 +07:00
history_database.dart perf: unify queue tab with DB-backed pagination and cross-database queries 2026-05-06 04:38:51 +07:00
library_collections_database.dart feat: add Favorite Artists collection 2026-05-02 00:50:02 +07:00
library_database.dart perf: unify queue tab with DB-backed pagination and cross-database queries 2026-05-06 04:38:51 +07:00
local_track_redownload_service.dart refactor: remove Qobuz built-in provider and delete qobuz.go 2026-04-18 23:32:16 +07:00
notification_service.dart fix: sync download progress notification states 2026-05-04 17:24:57 +07:00
platform_bridge.dart refactor: remove built-in provider registry in favor of extensions 2026-05-05 03:55:24 +07:00
share_intent_service.dart fix: stabilize shared extension link handling 2026-04-13 23:35:02 +07:00
shell_navigation_service.dart refactor: route spotify URLs through extensions 2026-04-13 23:32:11 +07:00
update_checker.dart chore: remove redundant comments and boilerplate across codebase 2026-05-05 21:35:18 +07:00