mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Allow retrieving count of available stable imports
This commit is contained in:
@ -111,6 +111,18 @@ namespace osu.Game.Collections
|
||||
|
||||
public Action<Notification> PostNotification { protected get; set; }
|
||||
|
||||
public Task<int> GetAvailableCount(StableStorage stableStorage)
|
||||
{
|
||||
if (!stableStorage.Exists(database_name))
|
||||
return Task.FromResult(0);
|
||||
|
||||
return Task.Run(() =>
|
||||
{
|
||||
using (var stream = stableStorage.GetStream(database_name))
|
||||
return readCollections(stream).Count;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is a temporary method and will likely be replaced by a full-fledged (and more correctly placed) migration process in the future.
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user