mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
fixed subtitle downloading
This commit is contained in:
@@ -11,6 +11,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
List<FileSystemInfo> GetFileSystemEntries(string path);
|
||||
IEnumerable<FileSystemInfo> GetFiles(string path);
|
||||
IEnumerable<FileSystemInfo> GetFiles(string path, bool clearCache);
|
||||
FileSystemInfo GetFile(string path);
|
||||
}
|
||||
|
||||
@@ -26,9 +27,21 @@ namespace MediaBrowser.Controller.Providers
|
||||
}
|
||||
|
||||
public List<FileSystemInfo> GetFileSystemEntries(string path)
|
||||
{
|
||||
return GetFileSystemEntries(path, false);
|
||||
}
|
||||
|
||||
private List<FileSystemInfo> GetFileSystemEntries(string path, bool clearCache)
|
||||
{
|
||||
List<FileSystemInfo> entries;
|
||||
|
||||
if (clearCache)
|
||||
{
|
||||
List<FileSystemInfo> removed;
|
||||
|
||||
_cache.TryRemove(path, out removed);
|
||||
}
|
||||
|
||||
if (!_cache.TryGetValue(path, out entries))
|
||||
{
|
||||
//_logger.Debug("Getting files for " + path);
|
||||
@@ -50,7 +63,12 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
public IEnumerable<FileSystemInfo> GetFiles(string path)
|
||||
{
|
||||
return GetFileSystemEntries(path).Where(i => (i.Attributes & FileAttributes.Directory) != FileAttributes.Directory);
|
||||
return GetFiles(path, false);
|
||||
}
|
||||
|
||||
public IEnumerable<FileSystemInfo> GetFiles(string path, bool clearCache)
|
||||
{
|
||||
return GetFileSystemEntries(path, clearCache).Where(i => (i.Attributes & FileAttributes.Directory) != FileAttributes.Directory);
|
||||
}
|
||||
|
||||
public FileSystemInfo GetFile(string path)
|
||||
|
||||
Reference in New Issue
Block a user