@@ -19,19 +19,19 @@ internal class SteamLibrary : ISteamLibrary
1919 TrailingDirectorySeparatorBehavior = TrailingDirectorySeparatorBehavior . Trim
2020 } ;
2121
22+ private readonly string _normalizedLocation ;
2223 private readonly ILogger ? _logger ;
2324 private readonly ConcurrentDictionary < KnownLibraryLocations , IDirectoryInfo > _locations = new ( ) ;
2425
26+ private protected readonly IFileSystem FileSystem ;
27+
2528 private readonly Dictionary < KnownLibraryLocations , string [ ] > _locationsNames = new ( )
2629 {
2730 { KnownLibraryLocations . SteamApps , [ "steamapps" ] } ,
2831 { KnownLibraryLocations . Common , [ "steamapps" , "common" ] } ,
2932 { KnownLibraryLocations . Workshops , [ "steamapps" , "workshop" ] }
3033 } ;
3134
32- private readonly string _normalizedLocation ;
33- private readonly IFileSystem _fileSystem ;
34-
3535 public IDirectoryInfo LibraryLocation { get ; }
3636
3737 public IDirectoryInfo SteamAppsLocation => GetKnownLibraryLocation ( KnownLibraryLocations . SteamApps ) ;
@@ -46,9 +46,9 @@ public SteamLibrary(IDirectoryInfo libraryLocation, IServiceProvider serviceProv
4646 throw new ArgumentNullException ( nameof ( libraryLocation ) ) ;
4747 if ( serviceProvider == null )
4848 throw new ArgumentNullException ( nameof ( serviceProvider ) ) ;
49- _fileSystem = serviceProvider . GetRequiredService < IFileSystem > ( ) ;
49+ FileSystem = serviceProvider . GetRequiredService < IFileSystem > ( ) ;
5050 _logger = serviceProvider . GetService < ILoggerFactory > ( ) ? . CreateLogger ( GetType ( ) ) ;
51- _normalizedLocation = PathNormalizer . Normalize ( _fileSystem . Path . GetFullPath ( libraryLocation . FullName ) , SteamLibraryPathNormalizeOptions ) ;
51+ _normalizedLocation = PathNormalizer . Normalize ( FileSystem . Path . GetFullPath ( libraryLocation . FullName ) , SteamLibraryPathNormalizeOptions ) ;
5252 LibraryLocation = libraryLocation ;
5353 }
5454
@@ -91,7 +91,7 @@ public bool Equals(ISteamLibrary? other)
9191 if ( ReferenceEquals ( this , other ) )
9292 return true ;
9393
94- var normalizedOtherPath = PathNormalizer . Normalize ( _fileSystem . Path . GetFullPath ( other . LibraryLocation . FullName ) , SteamLibraryPathNormalizeOptions ) ;
94+ var normalizedOtherPath = PathNormalizer . Normalize ( FileSystem . Path . GetFullPath ( other . LibraryLocation . FullName ) , SteamLibraryPathNormalizeOptions ) ;
9595 return _normalizedLocation . Equals ( normalizedOtherPath ) ;
9696 }
9797
0 commit comments