diff options
| author | JPVenson <github@jpb.email> | 2025-03-25 15:12:48 +0000 |
|---|---|---|
| committer | JPVenson <github@jpb.email> | 2025-03-25 15:12:48 +0000 |
| commit | 850f1c79f1319de56a300c1d62565c9b2793b7d8 (patch) | |
| tree | f307a380c63d80809fed23c7ce2c8a0d0aba5de8 /Emby.Server.Implementations/Library/PathManager.cs | |
| parent | ef7f6fc8a97118df7f410a7afa2f501f3f4ca3e2 (diff) | |
| parent | 671d801d9f734665d0acbd441246712ad2e3d91f (diff) | |
Merge branch 'master' into feature/DatabaseRefactor
Diffstat (limited to 'Emby.Server.Implementations/Library/PathManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/PathManager.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Library/PathManager.cs b/Emby.Server.Implementations/Library/PathManager.cs new file mode 100644 index 000000000..c910abadb --- /dev/null +++ b/Emby.Server.Implementations/Library/PathManager.cs @@ -0,0 +1,36 @@ +using System.Globalization; +using System.IO; +using MediaBrowser.Controller.Configuration; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.IO; + +namespace Emby.Server.Implementations.Library; + +/// <summary> +/// IPathManager implementation. +/// </summary> +public class PathManager : IPathManager +{ + private readonly IServerConfigurationManager _config; + + /// <summary> + /// Initializes a new instance of the <see cref="PathManager"/> class. + /// </summary> + /// <param name="config">The server configuration manager.</param> + public PathManager( + IServerConfigurationManager config) + { + _config = config; + } + + /// <inheritdoc /> + public string GetTrickplayDirectory(BaseItem item, bool saveWithMedia = false) + { + var basePath = _config.ApplicationPaths.TrickplayPath; + var idString = item.Id.ToString("N", CultureInfo.InvariantCulture); + + return saveWithMedia + ? Path.Combine(item.ContainingFolderPath, Path.ChangeExtension(item.Path, ".trickplay")) + : Path.Combine(basePath, idString); + } +} |
