mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 09:44:47 +03:00
Fix build
This commit is contained in:
@@ -43,18 +43,17 @@ namespace MediaBrowser.Controller.Providers
|
||||
return list;
|
||||
}
|
||||
|
||||
public FileSystemMetadata GetFile(string path)
|
||||
public FileSystemMetadata? GetFile(string path)
|
||||
{
|
||||
var result = _fileCache.GetOrAdd(path, p =>
|
||||
if (!_fileCache.TryGetValue(path, out var result))
|
||||
{
|
||||
var file = _fileSystem.GetFileInfo(p);
|
||||
return file != null && file.Exists ? file : null;
|
||||
});
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
// lets not store null results in the cache
|
||||
_fileCache.TryRemove(path, out _);
|
||||
var file = _fileSystem.GetFileInfo(path);
|
||||
var res = file != null && file.Exists ? file : null;
|
||||
if (res != null)
|
||||
{
|
||||
result = res;
|
||||
_fileCache.TryAdd(path, result);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user