Unwrapped GetFileNameWithoutExtension

This commit is contained in:
Erwin de Haan 2019-01-26 23:23:43 +01:00
parent b9a111432a
commit 450f246f95
5 changed files with 9 additions and 9 deletions

View File

@ -2509,7 +2509,7 @@ namespace MediaBrowser.Controller.Entities
if (string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(Path))
{
Name = FileSystem.GetFileNameWithoutExtension(Path);
Name = System.IO.Path.GetFileNameWithoutExtension(Path);
hasChanges = true;
}

View File

@ -34,7 +34,7 @@ namespace MediaBrowser.LocalMetadata.Images
var parentPathFiles = directoryService.GetFiles(parentPath);
var nameWithoutExtension = _fileSystem.GetFileNameWithoutExtension(item.Path);
var nameWithoutExtension = Path.GetFileNameWithoutExtension(item.Path);
return GetFilesFromParentFolder(nameWithoutExtension, parentPathFiles);
}

View File

@ -411,7 +411,7 @@ namespace MediaBrowser.Providers.Manager
filename = item is MusicAlbum ? "cdart" : "disc";
break;
case ImageType.Primary:
filename = saveLocally && item is Episode ? _fileSystem.GetFileNameWithoutExtension(item.Path) : folderName;
filename = saveLocally && item is Episode ? Path.GetFileNameWithoutExtension(item.Path) : folderName;
break;
case ImageType.Backdrop:
filename = GetBackdropSaveFilename(item.GetImages(type), "backdrop", "backdrop", imageIndex);
@ -471,7 +471,7 @@ namespace MediaBrowser.Providers.Manager
return zeroIndexFilename;
}
var filenames = images.Select(i => _fileSystem.GetFileNameWithoutExtension(i.Path)).ToList();
var filenames = images.Select(i => Path.GetFileNameWithoutExtension(i.Path)).ToList();
var current = 1;
while (filenames.Contains(numberedIndexPrefix + current.ToString(UsCulture), StringComparer.OrdinalIgnoreCase))
@ -571,7 +571,7 @@ namespace MediaBrowser.Providers.Manager
{
var seasonFolder = Path.GetDirectoryName(item.Path);
var imageFilename = _fileSystem.GetFileNameWithoutExtension(item.Path) + "-thumb" + extension;
var imageFilename = Path.GetFileNameWithoutExtension(item.Path) + "-thumb" + extension;
return new[] { Path.Combine(seasonFolder, imageFilename) };
}
@ -619,7 +619,7 @@ namespace MediaBrowser.Providers.Manager
}
var folder = Path.GetDirectoryName(item.Path);
return Path.Combine(folder, _fileSystem.GetFileNameWithoutExtension(item.Path) + "-" + imageFilename + extension);
return Path.Combine(folder, Path.GetFileNameWithoutExtension(item.Path) + "-" + imageFilename + extension);
}
}
}

View File

@ -98,7 +98,7 @@ namespace MediaBrowser.Providers.MediaInfo
int startIndex,
string[] files)
{
var videoFileNameWithoutExtension = _fileSystem.GetFileNameWithoutExtension(videoPath);
var videoFileNameWithoutExtension = Path.GetFileNameWithoutExtension(videoPath);
videoFileNameWithoutExtension = NormalizeFilenameForSubtitleComparison(videoFileNameWithoutExtension);
foreach (var fullName in files)
@ -110,7 +110,7 @@ namespace MediaBrowser.Providers.MediaInfo
continue;
}
var fileNameWithoutExtension = _fileSystem.GetFileNameWithoutExtension(fullName);
var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fullName);
fileNameWithoutExtension = NormalizeFilenameForSubtitleComparison(fileNameWithoutExtension);
if (!string.Equals(videoFileNameWithoutExtension, fileNameWithoutExtension, StringComparison.OrdinalIgnoreCase) &&

View File

@ -168,7 +168,7 @@ namespace MediaBrowser.Providers.Subtitles
memoryStream.Position = 0;
var savePaths = new List<string>();
var saveFileName = _fileSystem.GetFileNameWithoutExtension(video.Path) + "." + response.Language.ToLower();
var saveFileName = Path.GetFileNameWithoutExtension(video.Path) + "." + response.Language.ToLower();
if (response.IsForced)
{