osu/osu.Game/Database/LegacyScoreImporter.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
1.1 KiB
C#
Raw Normal View History

2021-11-25 07:56:19 +00: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.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using osu.Framework.Platform;
using osu.Game.Scoring;
namespace osu.Game.Database
{
public class LegacyScoreImporter : LegacyModelImporter<ScoreInfo>
{
protected override string ImportFromStablePath => Path.Combine("Data", "r");
protected override IEnumerable<string> GetStableImportPaths(Storage storage)
{
if (!storage.ExistsDirectory(ImportFromStablePath))
return Enumerable.Empty<string>();
return storage.GetFiles(ImportFromStablePath)
2023-02-18 17:56:53 +00:00
.Where(p => Importer.HandledExtensions.Any(ext => Path.GetExtension(p).Equals(ext, StringComparison.OrdinalIgnoreCase)))
.Select(path => storage.GetFullPath(path));
}
public LegacyScoreImporter(IModelImporter<ScoreInfo> importer)
: base(importer)
{
}
}
}