Skip to content

Commit

Permalink
Fix: Exclude offline audio data from user backup data
Browse files Browse the repository at this point in the history
  • Loading branch information
gokadzev committed Dec 21, 2023
1 parent 1f2319e commit cc9138f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/API/musify.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ List userLikedPlaylists =
Hive.box('user').get('likedPlaylists', defaultValue: []);
List userRecentlyPlayed =
Hive.box('user').get('recentlyPlayedSongs', defaultValue: []);
List userOfflineSongs = Hive.box('user').get('offlineSongs', defaultValue: []);
List userOfflineSongs =
Hive.box('user_nb').get('offlineSongs', defaultValue: []);
List suggestedPlaylists = [];
Map activePlaylist = {
'ytid': '',
Expand Down Expand Up @@ -561,7 +562,7 @@ void makeSongOffline(dynamic song) async {
}
song['audioPath'] = _audioFile.path;
userOfflineSongs.add(song);
addOrUpdateData('user', 'offlineSongs', userOfflineSongs);
addOrUpdateData('user_nb', 'offlineSongs', userOfflineSongs);
}

void removeSongFromOffline(dynamic songId) async {
Expand All @@ -575,7 +576,7 @@ void removeSongFromOffline(dynamic songId) async {
if (await _artworkFile.exists()) await _artworkFile.delete();

userOfflineSongs.removeWhere((song) => song['ytid'] == songId);
addOrUpdateData('user', 'offlineSongs', userOfflineSongs);
addOrUpdateData('user_nb', 'offlineSongs', userOfflineSongs);
currentOfflineSongsLength.value = userOfflineSongs.length;
}

Expand Down

0 comments on commit cc9138f

Please sign in to comment.