mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 10:42:55 +08:00
Don't batch imports for now.
This commit is contained in:
parent
ba73968303
commit
3401759665
@ -123,16 +123,15 @@ namespace osu.Game.Database
|
|||||||
/// <param name="paths">Multiple locations on disk</param>
|
/// <param name="paths">Multiple locations on disk</param>
|
||||||
public void Import(IEnumerable<string> paths)
|
public void Import(IEnumerable<string> paths)
|
||||||
{
|
{
|
||||||
Stack<BeatmapSetInfo> sets = new Stack<BeatmapSetInfo>();
|
|
||||||
|
|
||||||
foreach (string p in paths)
|
foreach (string p in paths)
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BeatmapSetInfo set = getBeatmapSet(p);
|
BeatmapSetInfo set = getBeatmapSet(p);
|
||||||
|
|
||||||
//If we have an ID then we already exist in the database.
|
//If we have an ID then we already exist in the database.
|
||||||
if (set.ID == 0)
|
if (set.ID == 0)
|
||||||
sets.Push(set);
|
Import(new[] { set });
|
||||||
|
|
||||||
// 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.
|
||||||
@ -152,9 +151,7 @@ namespace osu.Game.Database
|
|||||||
e = e.InnerException ?? e;
|
e = e.InnerException ?? e;
|
||||||
Logger.Error(e, @"Could not import beatmap set");
|
Logger.Error(e, @"Could not import beatmap set");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Batch commit with multiple sets to database
|
|
||||||
Import(sets);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user