// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.IO; using System.Linq; using osu.Framework.Platform; using osu.Game.Extensions; using osu.Game.Scoring; namespace osu.Game.Database { public class LegacyScoreExporter : LegacyExporter { protected override string FileExtension => ".osr"; public LegacyScoreExporter(Storage storage, IModelManager manager) : base(storage, manager) { } public override void ExportModelTo(ScoreInfo model, Stream outputStream) { var file = model.Files.SingleOrDefault(); if (file == null) return; using (var inputStream = UserFileStorage.GetStream(file.FileInfo.GetStoragePath())) inputStream.CopyTo(outputStream); } } }