Address CI inspections.

This commit is contained in:
Lucas A 2021-01-25 19:05:16 +01:00
parent 51d4da565c
commit a4a7f0c578
2 changed files with 6 additions and 7 deletions

View File

@ -17,26 +17,26 @@ namespace osu.Game.IO
private const string stable_songs_path = "Songs"; private const string stable_songs_path = "Songs";
private readonly DesktopGameHost host; private readonly DesktopGameHost host;
private string songs_path; private readonly string songsPath;
public StableStorage(string path, DesktopGameHost host) public StableStorage(string path, DesktopGameHost host)
: base(path, host) : base(path, host)
{ {
this.host = host; this.host = host;
songs_path = locateSongsDirectory(); songsPath = locateSongsDirectory();
} }
/// <summary> /// <summary>
/// Returns a <see cref="Storage"/> pointing to the osu-stable Songs directory. /// Returns a <see cref="Storage"/> pointing to the osu-stable Songs directory.
/// </summary> /// </summary>
public Storage GetSongStorage() => new DesktopStorage(songs_path, host); public Storage GetSongStorage() => new DesktopStorage(songsPath, host);
private string locateSongsDirectory() private string locateSongsDirectory()
{ {
var configFile = GetStream(GetFiles(".", "osu!.*.cfg").First()); var configFile = GetStream(GetFiles(".", "osu!.*.cfg").First());
var textReader = new StreamReader(configFile); var textReader = new StreamReader(configFile);
var songs_directory_path = Path.Combine(BasePath, stable_songs_path); var songsDirectoryPath = Path.Combine(BasePath, stable_songs_path);
while (!textReader.EndOfStream) while (!textReader.EndOfStream)
{ {
@ -46,13 +46,13 @@ namespace osu.Game.IO
{ {
var directory = line.Split('=')[1].TrimStart(); var directory = line.Split('=')[1].TrimStart();
if (Path.IsPathFullyQualified(directory)) if (Path.IsPathFullyQualified(directory))
songs_directory_path = directory; songsDirectoryPath = directory;
break; break;
} }
} }
return songs_directory_path; return songsDirectoryPath;
} }
} }
} }

View File

@ -28,7 +28,6 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Framework.Input.Bindings; using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Platform;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Collections; using osu.Game.Collections;