From 6fb6b5ed13545f753f3680940e7dcf39b14a2ea1 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 1 May 2024 21:16:45 +0300 Subject: [PATCH] Fixed: Migrate appdata folder on dotnet 8 for OSX --- .../EnvironmentInfo/AppFolderFactory.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs b/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs index 84bb2ad9c..55dfb4530 100644 --- a/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs +++ b/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs @@ -75,6 +75,17 @@ private void MigrateAppDataFolder() { try { + if (OsInfo.IsOsx) + { + var userAppDataFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile, Environment.SpecialFolderOption.DoNotVerify), ".config", "Radarr"); + + if (_diskProvider.FolderExists(userAppDataFolder) && !_diskProvider.FileExists(_appFolderInfo.GetConfigPath())) + { + _diskTransferService.MirrorFolder(userAppDataFolder, _appFolderInfo.AppDataFolder); + _diskProvider.DeleteFolder(userAppDataFolder, true); + } + } + var oldDbFile = Path.Combine(_appFolderInfo.AppDataFolder, "nzbdrone.db"); if (_startupContext.Args.ContainsKey(StartupContext.APPDATA))