aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Providers
diff options
context:
space:
mode:
authoroledfish <88390729+oledfish@users.noreply.github.com>2022-01-16 21:33:18 -0300
committerGitHub <noreply@github.com>2022-01-16 21:33:18 -0300
commit3b075a58027be4a2a3bdf662c70934f6cafafe87 (patch)
treeb4c226f25f843c3f2685c92e1edc3b3999716d34 /MediaBrowser.Controller/Providers
parent86a5e72a65df638df2cde349ccd2ad8c5d40f88c (diff)
parentef0708d876434a99ec647473c37295fab45a35fb (diff)
Merge branch 'jellyfin:master' into additional-episode-orders
Diffstat (limited to 'MediaBrowser.Controller/Providers')
-rw-r--r--MediaBrowser.Controller/Providers/DirectoryService.cs10
-rw-r--r--MediaBrowser.Controller/Providers/IExternalId.cs4
-rw-r--r--MediaBrowser.Controller/Providers/ImageRefreshOptions.cs7
-rw-r--r--MediaBrowser.Controller/Providers/ItemInfo.cs2
-rw-r--r--MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs4
-rw-r--r--MediaBrowser.Controller/Providers/MetadataResult.cs6
-rw-r--r--MediaBrowser.Controller/Providers/RefreshPriority.cs2
7 files changed, 18 insertions, 17 deletions
diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs
index b312702704..d4de97651f 100644
--- a/MediaBrowser.Controller/Providers/DirectoryService.cs
+++ b/MediaBrowser.Controller/Providers/DirectoryService.cs
@@ -12,11 +12,11 @@ namespace MediaBrowser.Controller.Providers
{
private readonly IFileSystem _fileSystem;
- private readonly ConcurrentDictionary<string, FileSystemMetadata[]> _cache = new (StringComparer.Ordinal);
+ private readonly ConcurrentDictionary<string, FileSystemMetadata[]> _cache = new(StringComparer.Ordinal);
- private readonly ConcurrentDictionary<string, FileSystemMetadata> _fileCache = new (StringComparer.Ordinal);
+ private readonly ConcurrentDictionary<string, FileSystemMetadata> _fileCache = new(StringComparer.Ordinal);
- private readonly ConcurrentDictionary<string, List<string>> _filePathCache = new (StringComparer.Ordinal);
+ private readonly ConcurrentDictionary<string, List<string>> _filePathCache = new(StringComparer.Ordinal);
public DirectoryService(IFileSystem fileSystem)
{
@@ -25,7 +25,7 @@ namespace MediaBrowser.Controller.Providers
public FileSystemMetadata[] GetFileSystemEntries(string path)
{
- return _cache.GetOrAdd(path, (p, fileSystem) => fileSystem.GetFileSystemEntries(p).ToArray(), _fileSystem);
+ return _cache.GetOrAdd(path, static (p, fileSystem) => fileSystem.GetFileSystemEntries(p).ToArray(), _fileSystem);
}
public List<FileSystemMetadata> GetFiles(string path)
@@ -69,7 +69,7 @@ namespace MediaBrowser.Controller.Providers
_filePathCache.TryRemove(path, out _);
}
- var filePaths = _filePathCache.GetOrAdd(path, (p, fileSystem) => fileSystem.GetFilePaths(p).ToList(), _fileSystem);
+ var filePaths = _filePathCache.GetOrAdd(path, static (p, fileSystem) => fileSystem.GetFilePaths(p).ToList(), _fileSystem);
if (sort)
{
diff --git a/MediaBrowser.Controller/Providers/IExternalId.cs b/MediaBrowser.Controller/Providers/IExternalId.cs
index e2dbef2bc1..0d847520d1 100644
--- a/MediaBrowser.Controller/Providers/IExternalId.cs
+++ b/MediaBrowser.Controller/Providers/IExternalId.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
@@ -35,7 +33,7 @@ namespace MediaBrowser.Controller.Providers
/// <summary>
/// Gets the URL format string for this id.
/// </summary>
- string UrlFormatString { get; }
+ string? UrlFormatString { get; }
/// <summary>
/// Determines whether this id supports a given item type.
diff --git a/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs b/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs
index 2ac4c728ba..a9d16a49e4 100644
--- a/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs
+++ b/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
#pragma warning disable CA1819, CS1591
using System;
@@ -29,6 +27,11 @@ namespace MediaBrowser.Controller.Providers
public bool IsAutomated { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether old metadata should be removed if it isn't replaced.
+ /// </summary>
+ public bool RemoveOldMetadata { get; set; }
+
public bool IsReplacingImage(ImageType type)
{
return ImageRefreshMode == MetadataRefreshMode.FullRefresh &&
diff --git a/MediaBrowser.Controller/Providers/ItemInfo.cs b/MediaBrowser.Controller/Providers/ItemInfo.cs
index b8dd416a2d..3a97127eaa 100644
--- a/MediaBrowser.Controller/Providers/ItemInfo.cs
+++ b/MediaBrowser.Controller/Providers/ItemInfo.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs b/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs
index a42c7f8b5e..a38bbaf695 100644
--- a/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs
+++ b/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs
@@ -4,6 +4,7 @@
using System;
using System.Linq;
+using Jellyfin.Extensions;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Providers;
@@ -29,6 +30,7 @@ namespace MediaBrowser.Controller.Providers
ReplaceAllImages = copy.ReplaceAllImages;
ReplaceImages = copy.ReplaceImages;
SearchResult = copy.SearchResult;
+ RemoveOldMetadata = copy.RemoveOldMetadata;
if (copy.RefreshPaths != null && copy.RefreshPaths.Length > 0)
{
@@ -58,7 +60,7 @@ namespace MediaBrowser.Controller.Providers
{
if (RefreshPaths != null && RefreshPaths.Length > 0)
{
- return RefreshPaths.Contains(item.Path ?? string.Empty, StringComparer.OrdinalIgnoreCase);
+ return RefreshPaths.Contains(item.Path ?? string.Empty, StringComparison.OrdinalIgnoreCase);
}
return true;
diff --git a/MediaBrowser.Controller/Providers/MetadataResult.cs b/MediaBrowser.Controller/Providers/MetadataResult.cs
index 2085ae4adf..58a0fa2a9a 100644
--- a/MediaBrowser.Controller/Providers/MetadataResult.cs
+++ b/MediaBrowser.Controller/Providers/MetadataResult.cs
@@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.Providers
{
// Images aren't always used so the allocation is a waste a lot of the time
private List<LocalImageInfo> _images;
- private List<(string url, ImageType type)> _remoteImages;
+ private List<(string Url, ImageType Type)> _remoteImages;
public MetadataResult()
{
@@ -27,9 +27,9 @@ namespace MediaBrowser.Controller.Providers
set => _images = value;
}
- public List<(string url, ImageType type)> RemoteImages
+ public List<(string Url, ImageType Type)> RemoteImages
{
- get => _remoteImages ??= new List<(string url, ImageType type)>();
+ get => _remoteImages ??= new List<(string Url, ImageType Type)>();
set => _remoteImages = value;
}
diff --git a/MediaBrowser.Controller/Providers/RefreshPriority.cs b/MediaBrowser.Controller/Providers/RefreshPriority.cs
index 3619f679d6..e4c39cea16 100644
--- a/MediaBrowser.Controller/Providers/RefreshPriority.cs
+++ b/MediaBrowser.Controller/Providers/RefreshPriority.cs
@@ -20,4 +20,4 @@
/// </summary>
Low = 2
}
-} \ No newline at end of file
+}