mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Allow files missing on disk to be restored on beatmap import
Previously, in the rare case the database became out of sync with the disk store, it was impossible to feasibly repair a beatmap. Now reimporting checks each file exists on disk and adds it back if it doesn't.
This commit is contained in:
@ -429,6 +429,15 @@ namespace osu.Game.Beatmaps
|
||||
if (beatmapSet != null)
|
||||
{
|
||||
Undelete(beatmapSet);
|
||||
|
||||
// ensure all files are present and accessible
|
||||
foreach (var f in beatmapSet.Files)
|
||||
{
|
||||
if (!storage.Exists(f.FileInfo.StoragePath))
|
||||
using (Stream s = reader.GetStream(f.Filename))
|
||||
files.Add(s, false);
|
||||
}
|
||||
|
||||
return beatmapSet;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user