refactor(core): preserve playlist data during SQLite schema drift recovery#932
Draft
Copilot wants to merge 2 commits into
Draft
refactor(core): preserve playlist data during SQLite schema drift recovery#932Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
…lite) - Add IDatabaseService/DatabaseService with 5-table SQLite schema - Register DatabaseService as singleton in DI container - Migrate LibraryService from protobuf .bin files to SQLite media_records table - Migrate PlaybackProgressTracker from last_positions.bin to playback_progress table - Migrate PlaylistService from JSON files to playlists/playlist_items tables - Strip all [ProtoContract]/[ProtoMember] annotations from model classes - Delete PersistentStorageLibrary.cs (now redundant) - Remove SaveToDiskAsync/LoadFromDiskAsync generic methods from IFilesService/FilesService - Remove protobuf-net package, add Microsoft.Data.Sqlite 8.0.6 - Delete stale .bin and Playlists folder on startup in App.xaml.cs - Update docs/PROJECT_STRUCTURE.md to reflect SQLite migration Co-authored-by: huynhsontung <31434093+huynhsontung@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
huynhsontung
June 13, 2026 05:05
View session
Co-authored-by: huynhsontung <31434093+huynhsontung@users.noreply.github.com>
Copilot
AI
changed the title
feat: replace Protobuf/JSON file storage with SQLite cache layer
refactor(core): preserve playlist data during SQLite schema drift recovery
Jun 16, 2026
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.
Playlist data should survive schema drift, unlike cache-like tables (library/media/progress). This change moves recovery from “recreate DB” to table-level reconciliation and simplifies playlist item persistence to only durable identifiers.
Database recovery strategy
DatabaseServiceinitialization to detect per-table schema drift viaPRAGMA table_info.library_folders,media_records,playback_progress).playlistsandplaylist_itemsthrough*_newtables to preserve playlist data.Playlist schema simplification
playlist_itemsto minimal durable fields:id,playlist_id,path,sort_orderRuntime data composition for playlists
PlaylistServicewrites to persist only path/order.playlist_itemswithmedia_recordsonpath.Internal DB DTOs (no tuple transport)
Screenbox.Core(DatabaseDtos.cs) for cache load/write and SQL parameter transport.LibraryServiceDB transport paths to use DTOs instead of tuple-based contracts.