Don't remove imported archives by default

This commit is contained in:
HoLLy
2019-06-27 14:41:11 +02:00
parent 55216dffb7
commit 12350d18b5
3 changed files with 10 additions and 1 deletions

View File

@ -176,7 +176,7 @@ namespace osu.Game.Database
// TODO: Add a check to prevent files from storage to be deleted.
try
{
if (import != null && File.Exists(path))
if (import != null && File.Exists(path) && ShouldRemoveArchive(path))
File.Delete(path);
}
catch (Exception e)
@ -503,6 +503,11 @@ namespace osu.Game.Database
/// </summary>
protected abstract IEnumerable<string> GetStableImportPaths();
/// <summary>
/// Should this archive be removed after importing?
/// </summary>
protected virtual bool ShouldRemoveArchive(string path) => false;
/// <summary>
/// This is a temporary method and will likely be replaced by a full-fledged (and more correctly placed) migration process in the future.
/// </summary>