1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-16 06:17:19 +08:00

Merge pull request from peppy/importer-clean-up-part-2

More clean-up work on realm/beatmap import flow
This commit is contained in:
Bartłomiej Dach 2022-06-15 16:14:41 +02:00 committed by GitHub
commit c9cb4250bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 15 additions and 30 deletions

@ -21,7 +21,6 @@ using osu.Game.IO.Archives;
using osu.Game.Models; using osu.Game.Models;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Stores;
using osu.Game.Tests.Resources; using osu.Game.Tests.Resources;
using Realms; using Realms;
using SharpCompress.Archives; using SharpCompress.Archives;

@ -1,16 +1,16 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable enable
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Game.Database;
using osu.Game.Extensions; using osu.Game.Extensions;
using osu.Game.Models; using osu.Game.Models;
using osu.Game.Stores;
#nullable enable
namespace osu.Game.Tests.Database namespace osu.Game.Tests.Database
{ {

@ -1,6 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable enable
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -13,7 +15,6 @@ using osu.Framework.Graphics.Textures;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Formats; using osu.Game.Beatmaps.Formats;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Extensions; using osu.Game.Extensions;
@ -25,9 +26,7 @@ using osu.Game.Rulesets.Objects;
using osu.Game.Skinning; using osu.Game.Skinning;
using Realms; using Realms;
#nullable enable namespace osu.Game.Beatmaps
namespace osu.Game.Stores
{ {
/// <summary> /// <summary>
/// Handles the storage and retrieval of Beatmaps/WorkingBeatmaps. /// Handles the storage and retrieval of Beatmaps/WorkingBeatmaps.

@ -21,7 +21,6 @@ using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Skinning; using osu.Game.Skinning;
using osu.Game.Stores;
using osu.Game.Utils; using osu.Game.Utils;
#nullable enable #nullable enable

@ -15,7 +15,6 @@ using osu.Game.Beatmaps.Formats;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Extensions; using osu.Game.Extensions;
using osu.Game.Skinning; using osu.Game.Skinning;
using osu.Game.Stores;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
#nullable enable #nullable enable
@ -41,8 +40,6 @@ namespace osu.Game.Beatmaps
{ {
} }
protected override bool ShouldDeleteArchive(string path) => Path.GetExtension(path)?.ToLowerInvariant() == ".osz";
/// <summary> /// <summary>
/// Saves an <see cref="IBeatmap"/> file against a given <see cref="BeatmapInfo"/>. /// Saves an <see cref="IBeatmap"/> file against a given <see cref="BeatmapInfo"/>.
/// </summary> /// </summary>

@ -17,7 +17,6 @@ using osu.Framework.Threading;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests;
using osu.Game.Stores;
using SharpCompress.Compressors; using SharpCompress.Compressors;
using SharpCompress.Compressors.BZip2; using SharpCompress.Compressors.BZip2;

@ -6,7 +6,6 @@
using System.IO; using System.IO;
using osu.Framework.Extensions; using osu.Framework.Extensions;
using osu.Game.IO.Archives; using osu.Game.IO.Archives;
using osu.Game.Stores;
using osu.Game.Utils; using osu.Game.Utils;
using SharpCompress.Common; using SharpCompress.Common;

@ -28,7 +28,6 @@ using osu.Game.Models;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Scoring; using osu.Game.Scoring;
using osu.Game.Skinning; using osu.Game.Skinning;
using osu.Game.Stores;
using Realms; using Realms;
using Realms.Exceptions; using Realms.Exceptions;

@ -1,6 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable enable
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -13,16 +15,13 @@ using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.Database;
using osu.Game.Extensions; using osu.Game.Extensions;
using osu.Game.IO.Archives; using osu.Game.IO.Archives;
using osu.Game.Models; using osu.Game.Models;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
using Realms; using Realms;
#nullable enable namespace osu.Game.Database
namespace osu.Game.Stores
{ {
/// <summary> /// <summary>
/// Encapsulates a model store class to give it import functionality. /// Encapsulates a model store class to give it import functionality.

@ -1,20 +1,19 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable enable
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Game.Database;
using osu.Game.Extensions; using osu.Game.Extensions;
using osu.Game.Models; using osu.Game.Models;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
using Realms; using Realms;
#nullable enable namespace osu.Game.Database
namespace osu.Game.Stores
{ {
/// <summary> /// <summary>
/// Class which adds all the missing pieces bridging the gap between <see cref="RealmArchiveModelImporter{TModel}"/> and (legacy) ArchiveModelManager. /// Class which adds all the missing pieces bridging the gap between <see cref="RealmArchiveModelImporter{TModel}"/> and (legacy) ArchiveModelManager.

@ -1,6 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable enable
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -9,14 +11,11 @@ using osu.Framework.IO.Stores;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Game.Database;
using osu.Game.Extensions; using osu.Game.Extensions;
using osu.Game.Models; using osu.Game.Models;
using Realms; using Realms;
#nullable enable namespace osu.Game.Database
namespace osu.Game.Stores
{ {
/// <summary> /// <summary>
/// Handles the storing of files to the file system (and database) backing. /// Handles the storing of files to the file system (and database) backing.

@ -13,7 +13,6 @@ using osu.Game.Database;
using osu.Game.IO.Archives; using osu.Game.IO.Archives;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Scoring.Legacy; using osu.Game.Scoring.Legacy;
using osu.Game.Stores;
using Realms; using Realms;
#nullable enable #nullable enable

@ -14,7 +14,6 @@ using osu.Game.Database;
using osu.Game.Extensions; using osu.Game.Extensions;
using osu.Game.IO; using osu.Game.IO;
using osu.Game.IO.Archives; using osu.Game.IO.Archives;
using osu.Game.Stores;
using Realms; using Realms;
#nullable enable #nullable enable

@ -15,7 +15,6 @@ using osu.Framework.Platform;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Play; using osu.Game.Screens.Play;
using osu.Game.Stores;
namespace osu.Game.Storyboards.Drawables namespace osu.Game.Storyboards.Drawables
{ {