diff options
| author | Tim Eisele <Ghost_of_Stone@web.de> | 2025-03-23 17:05:13 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-23 10:05:13 -0600 |
| commit | 8db6a39e92acfd76689e77c71b00ac96e60c515b (patch) | |
| tree | 195a9ee6d854cae2f3283655023466b6ed9a5c8d /Emby.Server.Implementations/Library/PathManager.cs | |
| parent | 8b6aec7ce54df949b2940daa7f0c6b7d3201bda5 (diff) | |
Remove all DB data on item removal, delete internal trickplay files (#13753)
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); + } +} |
