mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 01:54:42 +01:00
add new file method overloads
This commit is contained in:
@@ -178,18 +178,18 @@ namespace Emby.Server.Implementations.FileOrganization
|
||||
/// <param name="extensions">The extensions.</param>
|
||||
private void DeleteLeftOverFiles(string path, IEnumerable<string> extensions)
|
||||
{
|
||||
var eligibleFiles = _fileSystem.GetFiles(path, extensions.ToArray(), false, true)
|
||||
var eligibleFiles = _fileSystem.GetFilePaths(path, extensions.ToArray(), false, true)
|
||||
.ToList();
|
||||
|
||||
foreach (var file in eligibleFiles)
|
||||
{
|
||||
try
|
||||
{
|
||||
_fileSystem.DeleteFile(file.FullName);
|
||||
_fileSystem.DeleteFile(file);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error deleting file {0}", ex, file.FullName);
|
||||
_logger.ErrorException("Error deleting file {0}", ex, file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1255,9 +1255,9 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
private string GetCollectionType(string path)
|
||||
{
|
||||
return _fileSystem.GetFiles(path, new[] { ".collection" }, true, false)
|
||||
return _fileSystem.GetFilePaths(path, new[] { ".collection" }, true, false)
|
||||
.Select(i => _fileSystem.GetFileNameWithoutExtension(i))
|
||||
.FirstOrDefault();
|
||||
.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user