2021-11-25 16:56:19 +09:00
|
|
|
// 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.
|
|
|
|
|
2022-06-17 16:37:17 +09:00
|
|
|
#nullable disable
|
|
|
|
|
2021-11-25 15:36:12 +09:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.IO;
|
|
|
|
using System.Linq;
|
|
|
|
using osu.Framework.Platform;
|
|
|
|
using osu.Game.Scoring;
|
|
|
|
|
|
|
|
namespace osu.Game.Database
|
|
|
|
{
|
2021-11-25 16:33:04 +09:00
|
|
|
public class LegacyScoreImporter : LegacyModelImporter<ScoreInfo>
|
2021-11-25 15:36:12 +09:00
|
|
|
{
|
|
|
|
protected override string ImportFromStablePath => Path.Combine("Data", "r");
|
|
|
|
|
|
|
|
protected override IEnumerable<string> GetStableImportPaths(Storage storage)
|
2022-05-17 16:55:41 +09:00
|
|
|
{
|
|
|
|
if (!storage.ExistsDirectory(ImportFromStablePath))
|
|
|
|
return Enumerable.Empty<string>();
|
|
|
|
|
|
|
|
return storage.GetFiles(ImportFromStablePath)
|
|
|
|
.Where(p => Importer.HandledExtensions.Any(ext => Path.GetExtension(p)?.Equals(ext, StringComparison.OrdinalIgnoreCase) ?? false))
|
|
|
|
.Select(path => storage.GetFullPath(path));
|
|
|
|
}
|
2021-11-25 15:36:12 +09:00
|
|
|
|
2021-11-25 15:39:05 +09:00
|
|
|
public LegacyScoreImporter(IModelImporter<ScoreInfo> importer)
|
2021-11-25 15:36:12 +09:00
|
|
|
: base(importer)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|