mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:03:13 +08:00
Address remaining reviews suggestions.
This commit is contained in:
parent
2a2b6f347e
commit
383c40b992
@ -64,7 +64,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
protected override string[] HashableFileTypes => new[] { ".osu" };
|
||||
|
||||
protected override bool CheckStableDirectoryExists(StableStorage stableStorage) => stableStorage.GetSongStorage().ExistsDirectory(".");
|
||||
protected override bool StableDirectoryExists(StableStorage stableStorage) => stableStorage.GetSongStorage().ExistsDirectory(".");
|
||||
|
||||
protected override IEnumerable<string> GetStableImportPaths(StableStorage stableStorage)
|
||||
{
|
||||
|
@ -640,10 +640,10 @@ namespace osu.Game.Database
|
||||
/// <summary>
|
||||
/// Checks for the existence of an osu-stable directory.
|
||||
/// </summary>
|
||||
protected virtual bool CheckStableDirectoryExists(StableStorage stableStorage) => stableStorage.ExistsDirectory(ImportFromStablePath);
|
||||
protected virtual bool StableDirectoryExists(StableStorage stableStorage) => stableStorage.ExistsDirectory(ImportFromStablePath);
|
||||
|
||||
/// <summary>
|
||||
/// Select paths to import from stable. Default implementation iterates all directories in <see cref="ImportFromStablePath"/>.
|
||||
/// Select paths to import from stable where all paths should be absolute. Default implementation iterates all directories in <see cref="ImportFromStablePath"/>.
|
||||
/// </summary>
|
||||
protected virtual IEnumerable<string> GetStableImportPaths(StableStorage stableStorage) => stableStorage.GetDirectories(ImportFromStablePath)
|
||||
.Select(path => stableStorage.GetFullPath(path));
|
||||
@ -668,7 +668,7 @@ namespace osu.Game.Database
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
if (!CheckStableDirectoryExists(stable))
|
||||
if (!StableDirectoryExists(stable))
|
||||
{
|
||||
// This handles situations like when the user does not have a Skins folder
|
||||
Logger.Log($"No {ImportFromStablePath} folder available in osu!stable installation", LoggingTarget.Information, LogLevel.Error);
|
||||
|
@ -35,12 +35,13 @@ namespace osu.Game.IO
|
||||
{
|
||||
var songsDirectoryPath = Path.Combine(BasePath, stable_default_songs_path);
|
||||
|
||||
var configFile = GetFiles(".", "osu!.*.cfg").FirstOrDefault();
|
||||
var configFile = GetFiles(".", "osu!.*.cfg").SingleOrDefault();
|
||||
|
||||
if (configFile == null)
|
||||
return songsDirectoryPath;
|
||||
|
||||
using (var textReader = new StreamReader(GetStream(configFile)))
|
||||
using (var stream = GetStream(configFile))
|
||||
using (var textReader = new StreamReader(stream))
|
||||
{
|
||||
string line;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user