mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
FileStore logic fixes
This commit is contained in:
@ -95,8 +95,6 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
|
|
||||||
private OsuGameBase loadOsu(GameHost host)
|
private OsuGameBase loadOsu(GameHost host)
|
||||||
{
|
{
|
||||||
host.Storage.DeleteDatabase(@"client");
|
|
||||||
|
|
||||||
var osu = new OsuGameBase();
|
var osu = new OsuGameBase();
|
||||||
Task.Run(() => host.Run(osu));
|
Task.Run(() => host.Run(osu));
|
||||||
|
|
||||||
|
@ -31,10 +31,6 @@ namespace osu.Game.IO
|
|||||||
{
|
{
|
||||||
if (reset)
|
if (reset)
|
||||||
{
|
{
|
||||||
// in earlier versions we stored beatmaps as solid archives, but not any more.
|
|
||||||
if (Storage.ExistsDirectory("beatmaps"))
|
|
||||||
Storage.DeleteDirectory("beatmaps");
|
|
||||||
|
|
||||||
if (Storage.ExistsDirectory(prefix))
|
if (Storage.ExistsDirectory(prefix))
|
||||||
Storage.DeleteDirectory(prefix);
|
Storage.DeleteDirectory(prefix);
|
||||||
|
|
||||||
@ -70,12 +66,14 @@ namespace osu.Game.IO
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (existing == null)
|
if (existing == null)
|
||||||
|
{
|
||||||
Connection.FileInfo.Add(info);
|
Connection.FileInfo.Add(info);
|
||||||
|
Connection.SaveChanges();
|
||||||
|
}
|
||||||
|
|
||||||
if (reference || existing == null)
|
if (reference || existing == null)
|
||||||
Reference(info);
|
Reference(info);
|
||||||
|
|
||||||
Connection.SaveChanges();
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,6 +83,7 @@ namespace osu.Game.IO
|
|||||||
{
|
{
|
||||||
var refetch = Connection.Find<FileInfo>(f.First().ID);
|
var refetch = Connection.Find<FileInfo>(f.First().ID);
|
||||||
refetch.ReferenceCount += f.Count();
|
refetch.ReferenceCount += f.Count();
|
||||||
|
Connection.Update(refetch);
|
||||||
}
|
}
|
||||||
|
|
||||||
Connection.SaveChanges();
|
Connection.SaveChanges();
|
||||||
@ -94,8 +93,9 @@ namespace osu.Game.IO
|
|||||||
{
|
{
|
||||||
foreach (var f in files.GroupBy(f => f.ID))
|
foreach (var f in files.GroupBy(f => f.ID))
|
||||||
{
|
{
|
||||||
var accurateRefCount = Connection.Find<FileInfo>(f.First().ID);
|
var refetch = Connection.Find<FileInfo>(f.First().ID);
|
||||||
accurateRefCount.ReferenceCount -= f.Count();
|
refetch.ReferenceCount -= f.Count();
|
||||||
|
Connection.Update(refetch);
|
||||||
}
|
}
|
||||||
|
|
||||||
Connection.SaveChanges();
|
Connection.SaveChanges();
|
||||||
@ -115,6 +115,8 @@ namespace osu.Game.IO
|
|||||||
Logger.Error(e, $@"Could not delete beatmap {f}");
|
Logger.Error(e, $@"Could not delete beatmap {f}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connection.SaveChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user