mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-01 13:28:27 +01:00
Unwrapped MoveDirectory, DirectoryExists, FileExists & removed MoveFile
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
@@ -2343,7 +2344,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
var newImagePaths = images.Select(i => i.FullName).ToList();
|
||||
|
||||
var deleted = existingImages
|
||||
.Where(i => i.IsLocalFile && !newImagePaths.Contains(i.Path, StringComparer.OrdinalIgnoreCase) && !FileSystem.FileExists(i.Path))
|
||||
.Where(i => i.IsLocalFile && !newImagePaths.Contains(i.Path, StringComparer.OrdinalIgnoreCase) && !File.Exists(i.Path))
|
||||
.ToList();
|
||||
|
||||
if (deleted.Count > 0)
|
||||
|
||||
@@ -168,14 +168,14 @@ namespace MediaBrowser.Controller.Entities
|
||||
var oldConfigurationDirectory = ConfigurationDirectoryPath;
|
||||
|
||||
// Exceptions will be thrown if these paths already exist
|
||||
if (FileSystem.DirectoryExists(newConfigDirectory))
|
||||
if (Directory.Exists(newConfigDirectory))
|
||||
{
|
||||
Directory.Delete(newConfigDirectory, true);
|
||||
}
|
||||
|
||||
if (FileSystem.DirectoryExists(oldConfigurationDirectory))
|
||||
if (Directory.Exists(oldConfigurationDirectory))
|
||||
{
|
||||
FileSystem.MoveDirectory(oldConfigurationDirectory, newConfigDirectory);
|
||||
Directory.Move(oldConfigurationDirectory, newConfigDirectory);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -434,7 +434,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
if (string.Equals(Path.GetExtension(subtitlePath), ".sub", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var idxFile = Path.ChangeExtension(subtitlePath, ".idx");
|
||||
if (_fileSystem.FileExists(idxFile))
|
||||
if (File.Exists(idxFile))
|
||||
{
|
||||
subtitlePath = idxFile;
|
||||
}
|
||||
@@ -542,7 +542,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
// var fallbackFontPath = Path.Combine(_appPaths.ProgramDataPath, "fonts", "DroidSansFallback.ttf");
|
||||
// string fallbackFontParam = string.Empty;
|
||||
|
||||
// if (!_fileSystem.FileExists(fallbackFontPath))
|
||||
// if (!File.Exists(fallbackFontPath))
|
||||
// {
|
||||
// _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(fallbackFontPath));
|
||||
// using (var stream = _assemblyInfo.GetManifestResourceStream(GetType(), GetType().Namespace + ".DroidSansFallback.ttf"))
|
||||
|
||||
Reference in New Issue
Block a user