mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 16:03:01 +08:00
Only delete on successful import.
This commit is contained in:
parent
7e72911d3a
commit
eff66a1da6
@ -126,13 +126,7 @@ namespace osu.Game.Database
|
|||||||
BeatmapSetInfo set = importBeatmapSet(p);
|
BeatmapSetInfo set = importBeatmapSet(p);
|
||||||
|
|
||||||
sets.Push(set);
|
sets.Push(set);
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Logger.Error(e, $@"Could not import beatmap set");
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
// We may or may not want to delete the file depending on where it is stored.
|
// We may or may not want to delete the file depending on where it is stored.
|
||||||
// e.g. reconstructing/repairing database with beatmaps from default storage.
|
// e.g. reconstructing/repairing database with beatmaps from default storage.
|
||||||
// TODO: Add a check to prevent files from storage to be deleted.
|
// TODO: Add a check to prevent files from storage to be deleted.
|
||||||
@ -145,6 +139,10 @@ namespace osu.Game.Database
|
|||||||
Logger.Error(e, $@"Could not delete file at {p}");
|
Logger.Error(e, $@"Could not delete file at {p}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Error(e, $@"Could not import beatmap set");
|
||||||
|
}
|
||||||
|
|
||||||
// Batch commit with multiple sets to database
|
// Batch commit with multiple sets to database
|
||||||
Import(sets);
|
Import(sets);
|
||||||
|
Loading…
Reference in New Issue
Block a user