mirror of
https://github.com/ppy/osu
synced 2024-12-16 11:56:31 +00:00
make ExportStorage
protected
This commit is contained in:
parent
d24e10e955
commit
f5d85f5774
@ -23,11 +23,11 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
protected readonly Storage UserFileStorage;
|
protected readonly Storage UserFileStorage;
|
||||||
|
|
||||||
private readonly Storage exportStorage;
|
protected readonly Storage ExportStorage;
|
||||||
|
|
||||||
protected LegacyExporter(Storage storage)
|
protected LegacyExporter(Storage storage)
|
||||||
{
|
{
|
||||||
exportStorage = storage.GetStorageForDirectory(@"exports");
|
ExportStorage = storage.GetStorageForDirectory(@"exports");
|
||||||
UserFileStorage = storage.GetStorageForDirectory(@"files");
|
UserFileStorage = storage.GetStorageForDirectory(@"files");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,14 +35,14 @@ namespace osu.Game.Database
|
|||||||
/// Exports an item to a legacy (.zip based) package.
|
/// Exports an item to a legacy (.zip based) package.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item to export.</param>
|
/// <param name="item">The item to export.</param>
|
||||||
public void Export(TModel item)
|
public virtual void Export(TModel item)
|
||||||
{
|
{
|
||||||
string filename = $"{item.GetDisplayString().GetValidFilename()}{FileExtension}";
|
string filename = $"{item.GetDisplayString().GetValidFilename()}{FileExtension}";
|
||||||
|
|
||||||
using (var stream = exportStorage.CreateFileSafely(filename))
|
using (var stream = ExportStorage.CreateFileSafely(filename))
|
||||||
ExportModelTo(item, stream);
|
ExportModelTo(item, stream);
|
||||||
|
|
||||||
exportStorage.PresentFileExternally(filename);
|
ExportStorage.PresentFileExternally(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user