Refactor to support beatmap updates

This commit is contained in:
smoogipoo
2020-01-02 13:20:38 +09:00
parent f745d74666
commit 681a43a318
3 changed files with 101 additions and 5 deletions

View File

@ -68,7 +68,7 @@ namespace osu.Game.Database
public virtual bool SupportsImportFromStable => RuntimeInfo.IsDesktop;
protected readonly FileStore Files;
public readonly FileStore Files;
protected readonly IDatabaseContextFactory ContextFactory;
@ -222,9 +222,8 @@ namespace osu.Game.Database
{
model = CreateModel(archive);
if (model == null) return Task.FromResult<TModel>(null);
model.Hash = computeHash(archive);
if (model == null)
return Task.FromResult<TModel>(null);
}
catch (TaskCanceledException)
{
@ -303,6 +302,7 @@ namespace osu.Game.Database
LogForModel(item, "Beginning import...");
item.Files = archive != null ? createFileInfos(archive, Files) : new List<TFileModel>();
item.Hash = archive != null ? computeHash(archive) : item.Hash;
await Populate(item, archive, cancellationToken);