diff --git a/RomRepoMgr.Blazor/Components/Dialogs/ImportRoms.razor.cs b/RomRepoMgr.Blazor/Components/Dialogs/ImportRoms.razor.cs index b15c9a9..48253d0 100644 --- a/RomRepoMgr.Blazor/Components/Dialogs/ImportRoms.razor.cs +++ b/RomRepoMgr.Blazor/Components/Dialogs/ImportRoms.razor.cs @@ -345,9 +345,6 @@ public partial class ImportRoms : ComponentBase tmpFile, reader.Entry.Size); - if(File.Exists(tmpFile)) File.Delete(tmpFile); - } - } try { if(File.Exists(tmpFile)) File.Delete(tmpFile); @@ -360,6 +357,12 @@ public partial class ImportRoms : ComponentBase #pragma warning restore PH2098 } } +#pragma warning disable RCS1075, PH2098, ERP022 + catch(Exception) + { + // Show must go on + } +#pragma warning restore RCS1075, PH2098, ERP022 finally { Interlocked.Increment(ref _listPosition); diff --git a/RomRepoMgr/ViewModels/ImportRomFolderViewModel.cs b/RomRepoMgr/ViewModels/ImportRomFolderViewModel.cs index a9e5547..ce37979 100644 --- a/RomRepoMgr/ViewModels/ImportRomFolderViewModel.cs +++ b/RomRepoMgr/ViewModels/ImportRomFolderViewModel.cs @@ -443,9 +443,6 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase tmpFile, reader.Entry.Size); - if(File.Exists(tmpFile)) File.Delete(tmpFile); - } - } try { if(File.Exists(tmpFile)) File.Delete(tmpFile); @@ -458,6 +455,20 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase #pragma warning restore PH2098 } } + catch(Exception) + { + Dispatcher.UIThread.Post(() => Importers.Add(new RomImporter + { + Filename = Path.GetFileName(archive), + Indeterminate = false, + Progress = 1, + Maximum = 1, + Minimum = 0, + StatusMessage = "Error processing archive." + })); +#pragma warning disable ERP022 + } +#pragma warning restore ERP022 finally { Interlocked.Increment(ref _listPosition);