From cc9138ff15725cc33ed639264cbe7530ee064859 Mon Sep 17 00:00:00 2001 From: Valeri Gokadze Date: Thu, 21 Dec 2023 10:44:23 +0400 Subject: [PATCH] Fix: Exclude offline audio data from user backup data --- lib/API/musify.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/API/musify.dart b/lib/API/musify.dart index fc88f4293..261ac69d1 100644 --- a/lib/API/musify.dart +++ b/lib/API/musify.dart @@ -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': '', @@ -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 { @@ -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; }