mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-04 15:28:23 +00:00
Cleanup file related code (#14023)
This commit is contained in:
parent
4096c973c6
commit
0c3ba30de2
17 changed files with 104 additions and 56 deletions
|
|
@ -159,13 +159,13 @@ namespace Emby.Server.Implementations.IO
|
|||
catch (IOException)
|
||||
{
|
||||
// Cross device move requires a copy
|
||||
Directory.CreateDirectory(destination);
|
||||
foreach (string file in Directory.GetFiles(source))
|
||||
var directory = Directory.CreateDirectory(destination);
|
||||
foreach (var file in directory.EnumerateFiles())
|
||||
{
|
||||
File.Copy(file, Path.Combine(destination, Path.GetFileName(file)), true);
|
||||
file.CopyTo(Path.Combine(destination, file.Name), true);
|
||||
}
|
||||
|
||||
Directory.Delete(source, true);
|
||||
directory.Delete(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue