diff options
| author | Tim Eisele <Tim_Eisele@web.de> | 2025-04-05 15:53:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-05 07:53:17 -0600 |
| commit | 2264d58ae75477595253b53d37560dd930586365 (patch) | |
| tree | c71a0359a915a81ba03efee13daaf8044d8306c6 | |
| parent | f7021d04ebc91eb78bc12ad4fea63ebe34ccc066 (diff) | |
Use subdirectories to organize extracted data (#13838)
* Use subdirectories to organize extracted data
* Apply suggestions from code review
| -rw-r--r-- | Emby.Server.Implementations/Library/PathManager.cs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/Library/PathManager.cs b/Emby.Server.Implementations/Library/PathManager.cs index ac004b413..83a6df964 100644 --- a/Emby.Server.Implementations/Library/PathManager.cs +++ b/Emby.Server.Implementations/Library/PathManager.cs @@ -42,15 +42,17 @@ public class PathManager : IPathManager /// <inheritdoc /> public string GetAttachmentFolderPath(string mediaSourceId) { - var id = Guid.Parse(mediaSourceId); - return Path.Join(AttachmentCachePath, id.ToString("D", CultureInfo.InvariantCulture)); + var id = Guid.Parse(mediaSourceId).ToString("D", CultureInfo.InvariantCulture).AsSpan(); + + return Path.Join(AttachmentCachePath, id[..2], id); } /// <inheritdoc /> public string GetSubtitleFolderPath(string mediaSourceId) { - var id = Guid.Parse(mediaSourceId); - return Path.Join(SubtitleCachePath, id.ToString("D", CultureInfo.InvariantCulture)); + var id = Guid.Parse(mediaSourceId).ToString("D", CultureInfo.InvariantCulture).AsSpan(); + + return Path.Join(SubtitleCachePath, id[..2], id); } /// <inheritdoc /> @@ -62,11 +64,10 @@ public class PathManager : IPathManager /// <inheritdoc /> public string GetTrickplayDirectory(BaseItem item, bool saveWithMedia = false) { - var basePath = _config.ApplicationPaths.TrickplayPath; - var idString = item.Id.ToString("D", CultureInfo.InvariantCulture); + var id = item.Id.ToString("D", CultureInfo.InvariantCulture).AsSpan(); return saveWithMedia ? Path.Combine(item.ContainingFolderPath, Path.ChangeExtension(item.Path, ".trickplay")) - : Path.Combine(basePath, idString); + : Path.Join(_config.ApplicationPaths.TrickplayPath, id[..2], id); } } |
