From 08a76007b73c4c451a4a029ab787c4bb43e2be6d Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Thu, 18 Jul 2024 15:59:51 -0400 Subject: [PATCH] #93: Making some changes to the process of saving a song to the filesystem --- Controllers/Managers/SongManager.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Controllers/Managers/SongManager.cs b/Controllers/Managers/SongManager.cs index 028fdbc..5e4d4da 100644 --- a/Controllers/Managers/SongManager.cs +++ b/Controllers/Managers/SongManager.cs @@ -224,10 +224,13 @@ public class SongManager : BaseManager _logger.Info("Temporary song path: {0}", tempPath); - using (var filestream = new FileStream(tempPath, FileMode.Create)) + if (!System.IO.File.Exists(tempPath)) { - _logger.Info("Saving song to temporary directory"); - songFile.CopyTo(filestream); + using (var filestream = new FileStream(tempPath, FileMode.Create)) + { + _logger.Info("Saving song to temporary directory"); + songFile.CopyTo(filestream); + } } var coverMgr = new CoverArtManager(_config);