mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Replace existing cases with new helper method
This commit is contained in:
@ -516,7 +516,7 @@ namespace osu.Game.Database
|
||||
{
|
||||
Files.Dereference(file.FileInfo);
|
||||
|
||||
if (file.ID > 0)
|
||||
if (file.IsManaged)
|
||||
{
|
||||
// This shouldn't be required, but here for safety in case the provided TModel is not being change tracked
|
||||
// Definitely can be removed once we rework the database backend.
|
||||
@ -545,7 +545,7 @@ namespace osu.Game.Database
|
||||
});
|
||||
}
|
||||
|
||||
if (model.ID > 0)
|
||||
if (model.IsManaged)
|
||||
Update(model);
|
||||
}
|
||||
|
||||
@ -811,7 +811,7 @@ namespace osu.Game.Database
|
||||
/// <param name="items">The usable items present in the store.</param>
|
||||
/// <returns>Whether the <typeparamref name="TModel"/> exists.</returns>
|
||||
protected virtual bool CheckLocalAvailability(TModel model, IQueryable<TModel> items)
|
||||
=> model.ID > 0 && items.Any(i => i.ID == model.ID && i.Files.Any());
|
||||
=> model.IsManaged && items.Any(i => i.ID == model.ID && i.Files.Any());
|
||||
|
||||
/// <summary>
|
||||
/// Whether import can be skipped after finding an existing import early in the process.
|
||||
|
Reference in New Issue
Block a user