mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 04:02:59 +08:00
Fix failed imports being incorrectly considered as successfully importing for notification purposes
This commit is contained in:
parent
98dcf487da
commit
ad8a710a69
@ -264,7 +264,7 @@ namespace osu.Game.Database
|
|||||||
model = CreateModel(archive);
|
model = CreateModel(archive);
|
||||||
|
|
||||||
if (model == null)
|
if (model == null)
|
||||||
return Task.FromResult<ILive<TModel>>(new EntityFrameworkLive<TModel>(null));
|
return Task.FromResult<ILive<TModel>>(null);
|
||||||
}
|
}
|
||||||
catch (TaskCanceledException)
|
catch (TaskCanceledException)
|
||||||
{
|
{
|
||||||
|
@ -7,6 +7,8 @@ using System.Threading.Tasks;
|
|||||||
using osu.Game.IO.Archives;
|
using osu.Game.IO.Archives;
|
||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.Notifications;
|
||||||
|
|
||||||
|
#nullable enable
|
||||||
|
|
||||||
namespace osu.Game.Database
|
namespace osu.Game.Database
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -26,7 +28,7 @@ namespace osu.Game.Database
|
|||||||
/// <param name="lowPriority">Whether this is a low priority import.</param>
|
/// <param name="lowPriority">Whether this is a low priority import.</param>
|
||||||
/// <param name="cancellationToken">An optional cancellation token.</param>
|
/// <param name="cancellationToken">An optional cancellation token.</param>
|
||||||
/// <returns>The imported model, if successful.</returns>
|
/// <returns>The imported model, if successful.</returns>
|
||||||
Task<ILive<TModel>> Import(ImportTask task, bool lowPriority = false, CancellationToken cancellationToken = default);
|
Task<ILive<TModel>?> Import(ImportTask task, bool lowPriority = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Silently import an item from an <see cref="ArchiveReader"/>.
|
/// Silently import an item from an <see cref="ArchiveReader"/>.
|
||||||
@ -34,7 +36,7 @@ namespace osu.Game.Database
|
|||||||
/// <param name="archive">The archive to be imported.</param>
|
/// <param name="archive">The archive to be imported.</param>
|
||||||
/// <param name="lowPriority">Whether this is a low priority import.</param>
|
/// <param name="lowPriority">Whether this is a low priority import.</param>
|
||||||
/// <param name="cancellationToken">An optional cancellation token.</param>
|
/// <param name="cancellationToken">An optional cancellation token.</param>
|
||||||
Task<ILive<TModel>> Import(ArchiveReader archive, bool lowPriority = false, CancellationToken cancellationToken = default);
|
Task<ILive<TModel>?> Import(ArchiveReader archive, bool lowPriority = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Silently import an item from a <typeparamref name="TModel"/>.
|
/// Silently import an item from a <typeparamref name="TModel"/>.
|
||||||
@ -43,7 +45,7 @@ namespace osu.Game.Database
|
|||||||
/// <param name="archive">An optional archive to use for model population.</param>
|
/// <param name="archive">An optional archive to use for model population.</param>
|
||||||
/// <param name="lowPriority">Whether this is a low priority import.</param>
|
/// <param name="lowPriority">Whether this is a low priority import.</param>
|
||||||
/// <param name="cancellationToken">An optional cancellation token.</param>
|
/// <param name="cancellationToken">An optional cancellation token.</param>
|
||||||
Task<ILive<TModel>> Import(TModel item, ArchiveReader archive = null, bool lowPriority = false, CancellationToken cancellationToken = default);
|
Task<ILive<TModel>?> Import(TModel item, ArchiveReader? archive = null, bool lowPriority = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A user displayable name for the model type associated with this manager.
|
/// A user displayable name for the model type associated with this manager.
|
||||||
|
Loading…
Reference in New Issue
Block a user