mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 12:02:54 +08:00
Hotfix importing scores from stable
This commit is contained in:
parent
c6c616f244
commit
d2f943395d
@ -52,6 +52,23 @@ namespace osu.Game.Scoring
|
||||
this.configManager = configManager;
|
||||
}
|
||||
|
||||
protected override void PreImport(ScoreInfo model)
|
||||
{
|
||||
var dbContext = ContextFactory.Get();
|
||||
|
||||
// Workaround System.InvalidOperationException
|
||||
// The instance of entity type 'FileInfo' cannot be tracked because another instance with the same key value for {'ID'} is already being tracked.
|
||||
foreach (var file in model.Files)
|
||||
{
|
||||
file.FileInfo = dbContext.FileInfo.Find(file.FileInfoID);
|
||||
}
|
||||
|
||||
foreach (var file in model.Beatmap.BeatmapSet.Files)
|
||||
{
|
||||
file.FileInfo = dbContext.FileInfo.Find(file.FileInfoID);
|
||||
}
|
||||
}
|
||||
|
||||
protected override ScoreInfo CreateModel(ArchiveReader archive)
|
||||
{
|
||||
if (archive == null)
|
||||
|
Loading…
Reference in New Issue
Block a user