aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-09-03 11:51:02 +0200
committerShadowghost <Ghost_of_Stone@web.de>2026-09-03 11:51:02 +0200
commitb724e57458e60e967bf05e943c5cf6b1a41f4044 (patch)
tree9ec216e1c55f0a818d89440a54817e9d50506b5b /MediaBrowser.Controller
parentd73e3d964e3ce8197ec86bdaad447072305bc0d6 (diff)
Reduce comments
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Providers/DirectoryService.cs14
1 files changed, 4 insertions, 10 deletions
diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs
index 336e35e293..613433391b 100644
--- a/MediaBrowser.Controller/Providers/DirectoryService.cs
+++ b/MediaBrowser.Controller/Providers/DirectoryService.cs
@@ -91,8 +91,7 @@ namespace MediaBrowser.Controller.Providers
{
var file = _fileSystem.GetFileSystemInfo(path);
- // Only a hit is remembered. A miss is the one answer that changes on its own, when
- // the file the path names turns up.
+ // Only cache hits: a missing file can turn up later.
if (file?.Exists ?? false)
{
result = file;
@@ -110,8 +109,7 @@ namespace MediaBrowser.Controller.Providers
{
if (clearCache)
{
- // Only what is remembered about this directory. Invalidate() also drops the parent,
- // which a write needs but which is needless churn on a shared cache here.
+ // Not Invalidate(), which would also drop the parent listing for no reason here.
Forget(path);
}
@@ -133,9 +131,6 @@ namespace MediaBrowser.Controller.Providers
public void Invalidate(string path)
{
- // Everything remembered about the path itself, and the listing of the directory holding
- // it, since writing a file changes what its directory contains. The caches belong to the
- // file system rather than to this instance, so this is felt by every reader of it.
Forget(path);
var parent = Path.GetDirectoryName(path);
@@ -162,9 +157,8 @@ namespace MediaBrowser.Controller.Providers
private const int DirectoryCacheSize = 2048;
private const int FileCacheSize = 8192;
- // A DirectoryService no longer bounds how long its answers are trusted by dying, so a
- // lifetime does. This is a staleness bound, not a snapshot: a long refresh can outlive it
- // and re-read a directory partway through.
+ // The cache outlives the DirectoryService instances reading it, so entries need their
+ // own staleness bound. A long refresh can outlive it and re-read a directory partway.
private static readonly TimeSpan _entryLifetime = TimeSpan.FromMinutes(1);
public ConcurrentTLru<string, FileSystemMetadata[]> Entries { get; }