Unwrapped GetFileNameWithoutExtension
This commit is contained in:
parent
b9a111432a
commit
450f246f95
|
@ -2509,7 +2509,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(Path))
|
if (string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(Path))
|
||||||
{
|
{
|
||||||
Name = FileSystem.GetFileNameWithoutExtension(Path);
|
Name = System.IO.Path.GetFileNameWithoutExtension(Path);
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||||
|
|
||||||
var parentPathFiles = directoryService.GetFiles(parentPath);
|
var parentPathFiles = directoryService.GetFiles(parentPath);
|
||||||
|
|
||||||
var nameWithoutExtension = _fileSystem.GetFileNameWithoutExtension(item.Path);
|
var nameWithoutExtension = Path.GetFileNameWithoutExtension(item.Path);
|
||||||
|
|
||||||
return GetFilesFromParentFolder(nameWithoutExtension, parentPathFiles);
|
return GetFilesFromParentFolder(nameWithoutExtension, parentPathFiles);
|
||||||
}
|
}
|
||||||
|
|
|
@ -411,7 +411,7 @@ namespace MediaBrowser.Providers.Manager
|
||||||
filename = item is MusicAlbum ? "cdart" : "disc";
|
filename = item is MusicAlbum ? "cdart" : "disc";
|
||||||
break;
|
break;
|
||||||
case ImageType.Primary:
|
case ImageType.Primary:
|
||||||
filename = saveLocally && item is Episode ? _fileSystem.GetFileNameWithoutExtension(item.Path) : folderName;
|
filename = saveLocally && item is Episode ? Path.GetFileNameWithoutExtension(item.Path) : folderName;
|
||||||
break;
|
break;
|
||||||
case ImageType.Backdrop:
|
case ImageType.Backdrop:
|
||||||
filename = GetBackdropSaveFilename(item.GetImages(type), "backdrop", "backdrop", imageIndex);
|
filename = GetBackdropSaveFilename(item.GetImages(type), "backdrop", "backdrop", imageIndex);
|
||||||
|
@ -471,7 +471,7 @@ namespace MediaBrowser.Providers.Manager
|
||||||
return zeroIndexFilename;
|
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;
|
var current = 1;
|
||||||
while (filenames.Contains(numberedIndexPrefix + current.ToString(UsCulture), StringComparer.OrdinalIgnoreCase))
|
while (filenames.Contains(numberedIndexPrefix + current.ToString(UsCulture), StringComparer.OrdinalIgnoreCase))
|
||||||
|
@ -571,7 +571,7 @@ namespace MediaBrowser.Providers.Manager
|
||||||
{
|
{
|
||||||
var seasonFolder = Path.GetDirectoryName(item.Path);
|
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) };
|
return new[] { Path.Combine(seasonFolder, imageFilename) };
|
||||||
}
|
}
|
||||||
|
@ -619,7 +619,7 @@ namespace MediaBrowser.Providers.Manager
|
||||||
}
|
}
|
||||||
var folder = Path.GetDirectoryName(item.Path);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
int startIndex,
|
int startIndex,
|
||||||
string[] files)
|
string[] files)
|
||||||
{
|
{
|
||||||
var videoFileNameWithoutExtension = _fileSystem.GetFileNameWithoutExtension(videoPath);
|
var videoFileNameWithoutExtension = Path.GetFileNameWithoutExtension(videoPath);
|
||||||
videoFileNameWithoutExtension = NormalizeFilenameForSubtitleComparison(videoFileNameWithoutExtension);
|
videoFileNameWithoutExtension = NormalizeFilenameForSubtitleComparison(videoFileNameWithoutExtension);
|
||||||
|
|
||||||
foreach (var fullName in files)
|
foreach (var fullName in files)
|
||||||
|
@ -110,7 +110,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileNameWithoutExtension = _fileSystem.GetFileNameWithoutExtension(fullName);
|
var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fullName);
|
||||||
fileNameWithoutExtension = NormalizeFilenameForSubtitleComparison(fileNameWithoutExtension);
|
fileNameWithoutExtension = NormalizeFilenameForSubtitleComparison(fileNameWithoutExtension);
|
||||||
|
|
||||||
if (!string.Equals(videoFileNameWithoutExtension, fileNameWithoutExtension, StringComparison.OrdinalIgnoreCase) &&
|
if (!string.Equals(videoFileNameWithoutExtension, fileNameWithoutExtension, StringComparison.OrdinalIgnoreCase) &&
|
||||||
|
|
|
@ -168,7 +168,7 @@ namespace MediaBrowser.Providers.Subtitles
|
||||||
memoryStream.Position = 0;
|
memoryStream.Position = 0;
|
||||||
|
|
||||||
var savePaths = new List<string>();
|
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)
|
if (response.IsForced)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user