replace file system calls with IFileSystem when needed

This commit is contained in:
Luke Pulverenti
2013-10-31 10:03:23 -04:00
parent 579b507f7f
commit 6c8d919298
80 changed files with 570 additions and 302 deletions

View File

@@ -1,4 +1,5 @@
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.IO;
@@ -1737,7 +1738,7 @@ namespace MediaBrowser.Controller.Entities
if (locationType == LocationType.Remote ||
locationType == LocationType.Virtual)
{
return File.GetLastWriteTimeUtc(imagePath);
return FileSystem.GetLastWriteTimeUtc(imagePath);
}
var metaFileEntry = ResolveArgs.GetMetaFileByPath(imagePath);
@@ -1754,7 +1755,7 @@ namespace MediaBrowser.Controller.Entities
}
// See if we can avoid a file system lookup by looking for the file in ResolveArgs
return metaFileEntry == null ? File.GetLastWriteTimeUtc(imagePath) : metaFileEntry.LastWriteTimeUtc;
return metaFileEntry == null ? FileSystem.GetLastWriteTimeUtc(imagePath) : FileSystem.GetLastWriteTimeUtc(metaFileEntry);
}
}
}

View File

@@ -165,7 +165,7 @@ namespace MediaBrowser.Controller.Entities
// Ensure it's been lazy loaded
var config = Configuration;
return File.GetLastWriteTimeUtc(ConfigurationFilePath);
return FileSystem.GetLastWriteTimeUtc(ConfigurationFilePath);
}
}