MetroList: Fixing Playlist Persistence Across Sync
Written by Alessio on 4/7/2026
Problem
Users reported songs disappearing from playlists after automatic sync completed. The sync ran, playlists appeared correct during execution, but post-sync the songs were gone.
The root cause: when adding songs to playlists, the app wasn't marking them as inLibrary. The sync logic interpreted these unmarked songs as orphaned and removed them.
Solution
Created addSongToPlaylistWithLibrarySync() function that marks songs as inLibrary when added to playlists. Updated all 12 entry points:
AddToPlaylistDialogAddToPlaylistDialogOnlineImportPlaylistDialogWrappedManagerMusicService.kt(Android Auto)YouTubePlaylistMenu.ktLocalPlaylistScreen.ktOnlinePlaylistScreen.ktHomeScreen.ktSyncUtils.kt(background sync)StatsViewModel.kt
Implementation also preserves setVideoId for playlist reordering and ensures atomic database transactions.
Result
Songs now persist across automatic sync. Playlists maintain their contents reliably.
Commit: MetrolistGroup/Metrolist@4ef332d
PR: #3446