mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-18 19:25:00 -04:00
Use subdirectories to organize extracted data (#13838)
* Use subdirectories to organize extracted data * Apply suggestions from code review
This commit is contained in:
parent
f7021d04eb
commit
2264d58ae7
1 changed files with 8 additions and 7 deletions
|
@ -42,15 +42,17 @@ public class PathManager : IPathManager
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string GetAttachmentFolderPath(string mediaSourceId)
|
public string GetAttachmentFolderPath(string mediaSourceId)
|
||||||
{
|
{
|
||||||
var id = Guid.Parse(mediaSourceId);
|
var id = Guid.Parse(mediaSourceId).ToString("D", CultureInfo.InvariantCulture).AsSpan();
|
||||||
return Path.Join(AttachmentCachePath, id.ToString("D", CultureInfo.InvariantCulture));
|
|
||||||
|
return Path.Join(AttachmentCachePath, id[..2], id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string GetSubtitleFolderPath(string mediaSourceId)
|
public string GetSubtitleFolderPath(string mediaSourceId)
|
||||||
{
|
{
|
||||||
var id = Guid.Parse(mediaSourceId);
|
var id = Guid.Parse(mediaSourceId).ToString("D", CultureInfo.InvariantCulture).AsSpan();
|
||||||
return Path.Join(SubtitleCachePath, id.ToString("D", CultureInfo.InvariantCulture));
|
|
||||||
|
return Path.Join(SubtitleCachePath, id[..2], id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
@ -62,11 +64,10 @@ public class PathManager : IPathManager
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string GetTrickplayDirectory(BaseItem item, bool saveWithMedia = false)
|
public string GetTrickplayDirectory(BaseItem item, bool saveWithMedia = false)
|
||||||
{
|
{
|
||||||
var basePath = _config.ApplicationPaths.TrickplayPath;
|
var id = item.Id.ToString("D", CultureInfo.InvariantCulture).AsSpan();
|
||||||
var idString = item.Id.ToString("D", CultureInfo.InvariantCulture);
|
|
||||||
|
|
||||||
return saveWithMedia
|
return saveWithMedia
|
||||||
? Path.Combine(item.ContainingFolderPath, Path.ChangeExtension(item.Path, ".trickplay"))
|
? Path.Combine(item.ContainingFolderPath, Path.ChangeExtension(item.Path, ".trickplay"))
|
||||||
: Path.Combine(basePath, idString);
|
: Path.Join(_config.ApplicationPaths.TrickplayPath, id[..2], id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue