mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
[App] Remove possible leftover temporary files.
This commit is contained in:
@@ -334,11 +334,15 @@ public partial class ImportRoms : ComponentBase
|
|||||||
KnownOnlyChecked,
|
KnownOnlyChecked,
|
||||||
RemoveFilesChecked);
|
RemoveFilesChecked);
|
||||||
|
|
||||||
|
string tmpFile = Path.Combine(Settings.Settings.Current.RepositoryPath,
|
||||||
|
Path.GetRandomFileName());
|
||||||
|
|
||||||
worker.ImportAndHashRom(reader.OpenEntryStream(),
|
worker.ImportAndHashRom(reader.OpenEntryStream(),
|
||||||
reader.Entry.Key,
|
reader.Entry.Key,
|
||||||
Path.Combine(Settings.Settings.Current.RepositoryPath,
|
tmpFile,
|
||||||
Path.GetFileName(Path.GetTempFileName())),
|
|
||||||
reader.Entry.Size);
|
reader.Entry.Size);
|
||||||
|
|
||||||
|
if(File.Exists(tmpFile)) File.Delete(tmpFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(InvalidOperationException) {}
|
catch(InvalidOperationException) {}
|
||||||
|
|||||||
@@ -432,11 +432,15 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
|||||||
|
|
||||||
Dispatcher.UIThread.Post(() => Importers.Add(model));
|
Dispatcher.UIThread.Post(() => Importers.Add(model));
|
||||||
|
|
||||||
|
string tmpFile = Path.Combine(Settings.Settings.Current.RepositoryPath,
|
||||||
|
Path.GetRandomFileName());
|
||||||
|
|
||||||
worker.ImportAndHashRom(reader.OpenEntryStream(),
|
worker.ImportAndHashRom(reader.OpenEntryStream(),
|
||||||
reader.Entry.Key,
|
reader.Entry.Key,
|
||||||
Path.Combine(Settings.Settings.Current.RepositoryPath,
|
tmpFile,
|
||||||
Path.GetFileName(Path.GetTempFileName())),
|
|
||||||
reader.Entry.Size);
|
reader.Entry.Size);
|
||||||
|
|
||||||
|
if(File.Exists(tmpFile)) File.Delete(tmpFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(InvalidOperationException) {}
|
catch(InvalidOperationException) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user