mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 10:52:55 +08:00
Fix incorrect continuation in ImportAsUpdate
causing UI blockage
This commit is contained in:
parent
efbbfab59d
commit
2eb6cf57af
@ -43,7 +43,9 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public override async Task<Live<BeatmapSetInfo>?> ImportAsUpdate(ProgressNotification notification, ImportTask importTask, BeatmapSetInfo original)
|
public override async Task<Live<BeatmapSetInfo>?> ImportAsUpdate(ProgressNotification notification, ImportTask importTask, BeatmapSetInfo original)
|
||||||
{
|
{
|
||||||
var imported = await Import(notification, new[] { importTask }).ConfigureAwait(true);
|
Guid originalId = original.ID;
|
||||||
|
|
||||||
|
var imported = await Import(notification, new[] { importTask }).ConfigureAwait(false);
|
||||||
|
|
||||||
if (!imported.Any())
|
if (!imported.Any())
|
||||||
return null;
|
return null;
|
||||||
@ -53,7 +55,7 @@ namespace osu.Game.Beatmaps
|
|||||||
var first = imported.First();
|
var first = imported.First();
|
||||||
|
|
||||||
// If there were no changes, ensure we don't accidentally nuke ourselves.
|
// If there were no changes, ensure we don't accidentally nuke ourselves.
|
||||||
if (first.ID == original.ID)
|
if (first.ID == originalId)
|
||||||
{
|
{
|
||||||
first.PerformRead(s =>
|
first.PerformRead(s =>
|
||||||
{
|
{
|
||||||
@ -69,7 +71,8 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
Logger.Log($"Beatmap \"{updated}\" update completed successfully", LoggingTarget.Database);
|
Logger.Log($"Beatmap \"{updated}\" update completed successfully", LoggingTarget.Database);
|
||||||
|
|
||||||
original = realm!.Find<BeatmapSetInfo>(original.ID)!;
|
// Re-fetch as we are likely on a different thread.
|
||||||
|
original = realm!.Find<BeatmapSetInfo>(originalId)!;
|
||||||
|
|
||||||
// Generally the import process will do this for us if the OnlineIDs match,
|
// Generally the import process will do this for us if the OnlineIDs match,
|
||||||
// but that isn't a guarantee (ie. if the .osu file doesn't have OnlineIDs populated).
|
// but that isn't a guarantee (ie. if the .osu file doesn't have OnlineIDs populated).
|
||||||
|
Loading…
Reference in New Issue
Block a user