aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorTim Eisele <Shadowghost@users.noreply.github.com>2024-09-07 19:23:48 +0200
committerGitHub <noreply@github.com>2024-09-07 11:23:48 -0600
commitc56dbc1c4410e1b0ec31ca901809b6f627bbb6ed (patch)
tree56df7024be555125eae955da94dd5dda248b8f59 /Emby.Server.Implementations
parent675a8a9ec91da47e37ace6161ba5a5a0e20a7839 (diff)
Enhance Trickplay (#11883)
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/IO/ManagedFileSystem.cs38
-rw-r--r--Emby.Server.Implementations/Localization/Core/en-US.json4
2 files changed, 26 insertions, 16 deletions
diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
index 28bb29df8..4b68f21d5 100644
--- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs
+++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
@@ -149,6 +149,26 @@ namespace Emby.Server.Implementations.IO
}
}
+ /// <inheritdoc />
+ public void MoveDirectory(string source, string destination)
+ {
+ try
+ {
+ Directory.Move(source, destination);
+ }
+ catch (IOException)
+ {
+ // Cross device move requires a copy
+ Directory.CreateDirectory(destination);
+ foreach (string file in Directory.GetFiles(source))
+ {
+ File.Copy(file, Path.Combine(destination, Path.GetFileName(file)), true);
+ }
+
+ Directory.Delete(source, true);
+ }
+ }
+
/// <summary>
/// Returns a <see cref="FileSystemMetadata"/> object for the specified file or directory path.
/// </summary>
@@ -327,11 +347,7 @@ namespace Emby.Server.Implementations.IO
}
}
- /// <summary>
- /// Gets the creation time UTC.
- /// </summary>
- /// <param name="path">The path.</param>
- /// <returns>DateTime.</returns>
+ /// <inheritdoc />
public virtual DateTime GetCreationTimeUtc(string path)
{
return GetCreationTimeUtc(GetFileSystemInfo(path));
@@ -368,11 +384,7 @@ namespace Emby.Server.Implementations.IO
}
}
- /// <summary>
- /// Gets the last write time UTC.
- /// </summary>
- /// <param name="path">The path.</param>
- /// <returns>DateTime.</returns>
+ /// <inheritdoc />
public virtual DateTime GetLastWriteTimeUtc(string path)
{
return GetLastWriteTimeUtc(GetFileSystemInfo(path));
@@ -446,11 +458,7 @@ namespace Emby.Server.Implementations.IO
File.SetAttributes(path, attributes);
}
- /// <summary>
- /// Swaps the files.
- /// </summary>
- /// <param name="file1">The file1.</param>
- /// <param name="file2">The file2.</param>
+ /// <inheritdoc />
public virtual void SwapFiles(string file1, string file2)
{
ArgumentException.ThrowIfNullOrEmpty(file1);
diff --git a/Emby.Server.Implementations/Localization/Core/en-US.json b/Emby.Server.Implementations/Localization/Core/en-US.json
index d1410ef5e..d248fc303 100644
--- a/Emby.Server.Implementations/Localization/Core/en-US.json
+++ b/Emby.Server.Implementations/Localization/Core/en-US.json
@@ -131,5 +131,7 @@
"TaskKeyframeExtractor": "Keyframe Extractor",
"TaskKeyframeExtractorDescription": "Extracts keyframes from video files to create more precise HLS playlists. This task may run for a long time.",
"TaskCleanCollectionsAndPlaylists": "Clean up collections and playlists",
- "TaskCleanCollectionsAndPlaylistsDescription": "Removes items from collections and playlists that no longer exist."
+ "TaskCleanCollectionsAndPlaylistsDescription": "Removes items from collections and playlists that no longer exist.",
+ "TaskMoveTrickplayImages": "Migrate Trickplay Image Location",
+ "TaskMoveTrickplayImagesDescription": "Moves existing trickplay files according to the library settings."
}