diff options
Diffstat (limited to 'Emby.Server.Implementations')
10 files changed, 24 insertions, 17 deletions
diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs index a92185994..ec3ca8ead 100644 --- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs +++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs @@ -210,7 +210,8 @@ namespace Emby.Server.Implementations.AppBase { var file = Path.Combine(path, Guid.NewGuid().ToString()); - FileSystem.WriteAllText(file, string.Empty); + string text = string.Empty; + File.WriteAllText(file, text); FileSystem.DeleteFile(file); } diff --git a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs index b9af663a9..3faad76e7 100644 --- a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs +++ b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs @@ -29,7 +29,7 @@ namespace Emby.Server.Implementations.AppBase // Use try/catch to avoid the extra file system lookup using File.Exists try { - buffer = fileSystem.ReadAllBytes(path); + buffer = File.ReadAllBytes(path); configuration = xmlSerializer.DeserializeFromBytes(type, buffer); } @@ -51,7 +51,7 @@ namespace Emby.Server.Implementations.AppBase Directory.CreateDirectory(Path.GetDirectoryName(path)); // Save it after load in case we got new items - fileSystem.WriteAllBytes(path, newBytes); + File.WriteAllBytes(path, newBytes); } return configuration; diff --git a/Emby.Server.Implementations/Devices/DeviceId.cs b/Emby.Server.Implementations/Devices/DeviceId.cs index 9640e7abb..866bd137f 100644 --- a/Emby.Server.Implementations/Devices/DeviceId.cs +++ b/Emby.Server.Implementations/Devices/DeviceId.cs @@ -57,7 +57,7 @@ namespace Emby.Server.Implementations.Devices lock (_syncLock) { - _fileSystem.WriteAllText(path, id, Encoding.UTF8); + File.WriteAllText(path, id, Encoding.UTF8); } } catch (Exception ex) diff --git a/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs b/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs index a306f94b3..5e5e91bb3 100644 --- a/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs +++ b/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs @@ -24,7 +24,7 @@ namespace Emby.Server.Implementations.IO if (string.Equals(Path.GetExtension(shortcutPath), ".mblink", StringComparison.OrdinalIgnoreCase)) { - var path = _fileSystem.ReadAllText(shortcutPath); + var path = File.ReadAllText(shortcutPath); return _fileSystem.NormalizePath(path); } @@ -44,7 +44,7 @@ namespace Emby.Server.Implementations.IO throw new ArgumentNullException(nameof(targetPath)); } - _fileSystem.WriteAllText(shortcutPath, targetPath); + File.WriteAllText(shortcutPath, targetPath); } } } diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index bf7404824..f96a211ec 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -2889,7 +2889,7 @@ namespace Emby.Server.Implementations.Library { var path = Path.Combine(virtualFolderPath, collectionType + ".collection"); - _fileSystem.WriteAllBytes(path, Array.Empty<byte>()); + File.WriteAllBytes(path, Array.Empty<byte>()); } CollectionFolder.SaveLibraryOptions(virtualFolderPath, options); diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs index 0b87455a4..05fce4542 100644 --- a/Emby.Server.Implementations/Library/UserManager.cs +++ b/Emby.Server.Implementations/Library/UserManager.cs @@ -904,7 +904,7 @@ namespace Emby.Server.Implementations.Library // Tuesday, 22 August 2006 06:30 AM text.AppendLine("The pin code will expire at " + localExpirationTime.ToString("f1", CultureInfo.CurrentCulture)); - _fileSystem.WriteAllText(path, text.ToString(), Encoding.UTF8); + File.WriteAllText(path, text.ToString(), Encoding.UTF8); var result = new PasswordPinCreationResult { diff --git a/Emby.Server.Implementations/Playlists/PlaylistManager.cs b/Emby.Server.Implementations/Playlists/PlaylistManager.cs index 6b8afcb7f..29836e0bf 100644 --- a/Emby.Server.Implementations/Playlists/PlaylistManager.cs +++ b/Emby.Server.Implementations/Playlists/PlaylistManager.cs @@ -340,7 +340,8 @@ namespace Emby.Server.Implementations.Playlists playlist.PlaylistEntries.Add(entry); } - _fileSystem.WriteAllText(playlistPath, new WplContent().ToText(playlist)); + string text = new WplContent().ToText(playlist); + File.WriteAllText(playlistPath, text); } if (string.Equals(".zpl", extension, StringComparison.OrdinalIgnoreCase)) { @@ -373,7 +374,8 @@ namespace Emby.Server.Implementations.Playlists playlist.PlaylistEntries.Add(entry); } - _fileSystem.WriteAllText(playlistPath, new ZplContent().ToText(playlist)); + string text = new ZplContent().ToText(playlist); + File.WriteAllText(playlistPath, text); } if (string.Equals(".m3u", extension, StringComparison.OrdinalIgnoreCase)) { @@ -401,7 +403,8 @@ namespace Emby.Server.Implementations.Playlists playlist.PlaylistEntries.Add(entry); } - _fileSystem.WriteAllText(playlistPath, new M3uContent().ToText(playlist)); + string text = new M3uContent().ToText(playlist); + File.WriteAllText(playlistPath, text); } if (string.Equals(".m3u8", extension, StringComparison.OrdinalIgnoreCase)) { @@ -429,7 +432,8 @@ namespace Emby.Server.Implementations.Playlists playlist.PlaylistEntries.Add(entry); } - _fileSystem.WriteAllText(playlistPath, new M3u8Content().ToText(playlist)); + string text = new M3u8Content().ToText(playlist); + File.WriteAllText(playlistPath, text); } if (string.Equals(".pls", extension, StringComparison.OrdinalIgnoreCase)) { @@ -449,7 +453,8 @@ namespace Emby.Server.Implementations.Playlists playlist.PlaylistEntries.Add(entry); } - _fileSystem.WriteAllText(playlistPath, new PlsContent().ToText(playlist)); + string text = new PlsContent().ToText(playlist); + File.WriteAllText(playlistPath, text); } } diff --git a/Emby.Server.Implementations/ResourceFileManager.cs b/Emby.Server.Implementations/ResourceFileManager.cs index 8c1f765e2..890d848f4 100644 --- a/Emby.Server.Implementations/ResourceFileManager.cs +++ b/Emby.Server.Implementations/ResourceFileManager.cs @@ -37,7 +37,7 @@ namespace Emby.Server.Implementations public string ReadAllText(string basePath, string virtualPath) { - return _fileSystem.ReadAllText(GetResourcePath(basePath, virtualPath)); + return File.ReadAllText(GetResourcePath(basePath, virtualPath)); } private string GetResourcePath(string basePath, string virtualPath) diff --git a/Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs b/Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs index 4124063f0..c31bdd13d 100644 --- a/Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs @@ -105,7 +105,7 @@ namespace Emby.Server.Implementations.ScheduledTasks { try { - previouslyFailedImages = _fileSystem.ReadAllText(failHistoryPath) + previouslyFailedImages = File.ReadAllText(failHistoryPath) .Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries) .ToList(); } @@ -143,7 +143,8 @@ namespace Emby.Server.Implementations.ScheduledTasks Directory.CreateDirectory(parentPath); - _fileSystem.WriteAllText(failHistoryPath, string.Join("|", previouslyFailedImages.ToArray())); + string text = string.Join("|", previouslyFailedImages.ToArray()); + File.WriteAllText(failHistoryPath, text); } numComplete++; diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index 6706e5700..552155635 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -575,7 +575,7 @@ namespace Emby.Server.Implementations.Updates //If it is an archive - write out a version file so we know what it is if (isArchive) { - _fileSystem.WriteAllText(target + ".ver", package.versionStr); + File.WriteAllText(target + ".ver", package.versionStr); } } catch (IOException ex) |
