mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
add LegacyExportManager
This commit is contained in:
@ -1,36 +1,32 @@
|
||||
// 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.IO;
|
||||
using System.Linq;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Extensions;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using osu.Game.Scoring;
|
||||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
public class LegacyScoreExporter : LegacyExporter<ScoreInfo>
|
||||
public class LegacyScoreExporter : LegacyModelExporter<ScoreInfo>
|
||||
{
|
||||
protected override string FileExtension => ".osr";
|
||||
|
||||
public LegacyScoreExporter(Storage storage, INotificationOverlay? notificationOverlay)
|
||||
: base(storage, notificationOverlay)
|
||||
public LegacyScoreExporter(Storage storage, RealmAccess realm, ProgressNotification notification)
|
||||
: base(storage, realm, notification)
|
||||
{
|
||||
}
|
||||
|
||||
public override void ExportModelTo(ScoreInfo model, Stream outputStream)
|
||||
{
|
||||
var file = model.Files.SingleOrDefault();
|
||||
if (file == null)
|
||||
return;
|
||||
|
||||
using (var inputStream = UserFileStorage.GetStream(file.File.GetStoragePath()))
|
||||
inputStream.CopyTo(outputStream);
|
||||
|
||||
Notification.State = ProgressNotificationState.Completed;
|
||||
outputStream.Dispose();
|
||||
}
|
||||
//public override void ExportModelTo(ScoreInfo model, Stream outputStream)
|
||||
//{
|
||||
// var file = model.Files.SingleOrDefault();
|
||||
// if (file == null)
|
||||
// return;
|
||||
//
|
||||
// using (var inputStream = UserFileStorage.GetStream(file.File.GetStoragePath()))
|
||||
// inputStream.CopyTo(outputStream);
|
||||
//
|
||||
// Notification.State = ProgressNotificationState.Completed;
|
||||
// outputStream.Dispose();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user