Skip to content

fix: Correct song ID format in Netease playlist sync#1183

Merged
theovilardo merged 1 commit intotheovilardo:masterfrom
serein-213:feature/netease-playlist-sync
Feb 21, 2026
Merged

fix: Correct song ID format in Netease playlist sync#1183
theovilardo merged 1 commit intotheovilardo:masterfrom
serein-213:feature/netease-playlist-sync

Conversation

@serein-213
Copy link
Copy Markdown
Contributor

Bug Fix

Fixes empty playlists issue when syncing Netease Cloud playlists to app playlists.

Root Cause

The previous implementation used incorrect song ID format when populating app playlists. Netease songs in the unified library use negative Long IDs (format: -(NETEASE_SONG_ID_OFFSET + neteaseId)), but the playlist sync was storing incompatible ID formats that couldn't match database records.

Solution

Changed updateAppPlaylistForNeteasePlaylist() to use the correct unified song ID format:

  • Before (❌): "netease_${entity.id}" → Incompatible string format
  • After (✅): toUnifiedSongId(entity.neteaseId).toString() → Matches SongEntity IDs

This ensures playlist song IDs reference the same negative Long IDs stored in the unified library, allowing getSongsByIds() to correctly retrieve songs.

Technical Details

  • Modified ID generation in updateAppPlaylistForNeteasePlaylist()
  • Song IDs now generated using toUnifiedSongId() method
  • IDs converted to String to match Playlist.songIds type requirement
  • Maintains consistency with syncUnifiedLibrarySongsFromNetease() logic

Impact

✅ Netease playlist songs now display correctly in app playlists
✅ All playlist operations (play, shuffle, etc.) work as expected
✅ No changes to database schema or API contracts

Testing

  1. Sync Netease playlists
  2. Open any synced playlist in the Playlists tab
  3. Verify songs are visible and playable
  4. Verify song metadata (title, artist, album art) displays correctly

Related to

Follows up on #[1182] - Netease playlist sync feature

@theovilardo theovilardo merged commit 4867931 into theovilardo:master Feb 21, 2026
@serein-213 serein-213 deleted the feature/netease-playlist-sync branch February 21, 2026 22:50
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.

2 participants