mirror of
https://github.com/ppy/osu
synced 2025-02-02 11:21:59 +00:00
Don't remove imported archives by default
This commit is contained in:
parent
55216dffb7
commit
12350d18b5
@ -83,6 +83,8 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
protected override IEnumerable<string> GetStableImportPaths() => GetStableStorage().GetDirectories(ImportFromStablePath);
|
||||
|
||||
protected override bool ShouldRemoveArchive(string path) => Path.GetExtension(path)?.ToLowerInvariant() == ".osz";
|
||||
|
||||
protected override Task Populate(BeatmapSetInfo beatmapSet, ArchiveReader archive, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (archive != null)
|
||||
|
@ -176,7 +176,7 @@ namespace osu.Game.Database
|
||||
// TODO: Add a check to prevent files from storage to be deleted.
|
||||
try
|
||||
{
|
||||
if (import != null && File.Exists(path))
|
||||
if (import != null && File.Exists(path) && ShouldRemoveArchive(path))
|
||||
File.Delete(path);
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -503,6 +503,11 @@ namespace osu.Game.Database
|
||||
/// </summary>
|
||||
protected abstract IEnumerable<string> GetStableImportPaths();
|
||||
|
||||
/// <summary>
|
||||
/// Should this archive be removed after importing?
|
||||
/// </summary>
|
||||
protected virtual bool ShouldRemoveArchive(string path) => false;
|
||||
|
||||
/// <summary>
|
||||
/// This is a temporary method and will likely be replaced by a full-fledged (and more correctly placed) migration process in the future.
|
||||
/// </summary>
|
||||
|
@ -56,6 +56,8 @@ namespace osu.Game.Skinning
|
||||
|
||||
protected override IEnumerable<string> GetStableImportPaths() => GetStableStorage().GetDirectories(ImportFromStablePath);
|
||||
|
||||
protected override bool ShouldRemoveArchive(string path) => true;
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of all usable <see cref="SkinInfo"/>s. Includes the special default skin plus all skins from <see cref="GetAllUserSkins"/>.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user