The Free Software Media System - Server Backend & API
Use subdirectories to organize extracted data (#13838)
Tim Eisele2264d58ae754
diff --git a/Emby.Server.Implementations/Library/PathManager.cs b/Emby.Server.Implementations/Library/PathManager.csindex ac004b4132..83a6df9644 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);}}