mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:52:55 +08:00
Delegate file deletion to ImportTask
to allow overriding it
This commit is contained in:
parent
f87bb589a2
commit
f8537c1cbe
@ -51,6 +51,15 @@ namespace osu.Game.Database
|
||||
: getReaderFrom(Path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the file that is encapsulated by this <see cref="ImportTask"/>.
|
||||
/// </summary>
|
||||
public virtual void DeleteFile()
|
||||
{
|
||||
if (File.Exists(Path))
|
||||
File.Delete(Path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="ArchiveReader"/> from a stream.
|
||||
/// </summary>
|
||||
|
@ -201,8 +201,8 @@ namespace osu.Game.Database
|
||||
// TODO: Add a check to prevent files from storage to be deleted.
|
||||
try
|
||||
{
|
||||
if (import != null && File.Exists(task.Path) && ShouldDeleteArchive(task.Path))
|
||||
File.Delete(task.Path);
|
||||
if (import != null && ShouldDeleteArchive(task.Path))
|
||||
task.DeleteFile();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user