mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:12:54 +08:00
Rename delete method and improve xmldoc
This commit is contained in:
parent
fcdba6b3f5
commit
8346c50ce1
@ -82,9 +82,7 @@ namespace osu.Game.Beatmaps
|
||||
protected override ArchiveDownloadRequest<BeatmapSetInfo> CreateDownloadRequest(BeatmapSetInfo set, bool minimiseDownloadSize) =>
|
||||
new DownloadBeatmapSetRequest(set, minimiseDownloadSize);
|
||||
|
||||
protected override IEnumerable<string> GetStableImportPaths() => GetStableStorage().GetDirectories(ImportFromStablePath);
|
||||
|
||||
protected override bool ShouldRemoveArchive(string path) => Path.GetExtension(path)?.ToLowerInvariant() == ".osz";
|
||||
protected override bool ShouldDeleteArchive(string path) => Path.GetExtension(path)?.ToLowerInvariant() == ".osz";
|
||||
|
||||
protected override Task Populate(BeatmapSetInfo beatmapSet, ArchiveReader archive, CancellationToken cancellationToken = default)
|
||||
{
|
||||
|
@ -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) && ShouldRemoveArchive(path))
|
||||
if (import != null && File.Exists(path) && ShouldDeleteArchive(path))
|
||||
File.Delete(path);
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -504,9 +504,11 @@ namespace osu.Game.Database
|
||||
protected abstract IEnumerable<string> GetStableImportPaths();
|
||||
|
||||
/// <summary>
|
||||
/// Should this archive be removed after importing?
|
||||
/// Whether this specified path should be removed after successful import.
|
||||
/// </summary>
|
||||
protected virtual bool ShouldRemoveArchive(string path) => false;
|
||||
/// <param name="path">The path for consideration. May be a file or a directory.</param>
|
||||
/// <returns>Whether to perform deletion.</returns>
|
||||
protected virtual bool ShouldDeleteArchive(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.
|
||||
|
@ -57,7 +57,7 @@ namespace osu.Game.Skinning
|
||||
|
||||
protected override IEnumerable<string> GetStableImportPaths() => GetStableStorage().GetDirectories(ImportFromStablePath);
|
||||
|
||||
protected override bool ShouldRemoveArchive(string path) => Path.GetExtension(path)?.ToLowerInvariant() == ".osk";
|
||||
protected override bool ShouldDeleteArchive(string path) => Path.GetExtension(path)?.ToLowerInvariant() == ".osk";
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of all usable <see cref="SkinInfo"/>s. Includes the special default skin plus all skins from <see cref="GetAllUserSkins"/>.
|
||||
|
Loading…
Reference in New Issue
Block a user