mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Spite sync method ExportToStream
`uuid` to `model`
This commit is contained in:
@ -3,7 +3,6 @@
|
||||
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Extensions;
|
||||
using osu.Game.Overlays;
|
||||
@ -20,22 +19,14 @@ namespace osu.Game.Database
|
||||
|
||||
protected override string FileExtension => ".osr";
|
||||
|
||||
public override async Task ExportToStreamAsync(ScoreInfo uuid, Stream stream)
|
||||
protected override void ExportToStream(ScoreInfo model, Stream stream)
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
RealmAccess.Run(r =>
|
||||
{
|
||||
ScoreInfo model = r.Find<ScoreInfo>(uuid.ID);
|
||||
var file = model.Files.SingleOrDefault();
|
||||
if (file == null)
|
||||
return;
|
||||
|
||||
var file = model.Files.SingleOrDefault();
|
||||
if (file == null)
|
||||
return;
|
||||
|
||||
using (var inputStream = UserFileStorage.GetStream(file.File.GetStoragePath()))
|
||||
inputStream.CopyTo(stream);
|
||||
});
|
||||
}).ContinueWith(OnComplete);
|
||||
using (var inputStream = UserFileStorage.GetStream(file.File.GetStoragePath()))
|
||||
inputStream.CopyTo(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user