Merge pull request #8250 from Bond-009/minor18

Minor cleanup
This commit is contained in:
Claus Vium
2022-09-09 13:27:52 +02:00
committed by GitHub
12 changed files with 39 additions and 60 deletions

View File

@@ -1,5 +1,3 @@
#nullable disable
#pragma warning disable CS1591
using System.Text.Json.Serialization;
@@ -13,7 +11,7 @@ namespace MediaBrowser.Controller.Entities
public abstract class BasePluginFolder : Folder, ICollectionFolder
{
[JsonIgnore]
public virtual string CollectionType => null;
public virtual string? CollectionType => null;
[JsonIgnore]
public override bool SupportsInheritedParentImages => false;

View File

@@ -1,5 +1,3 @@
#nullable disable
using System;
using System.Linq;
using Jellyfin.Extensions;
@@ -19,9 +17,11 @@ namespace MediaBrowser.Controller.Entities
/// <param name="url">Trailer URL.</param>
public static void AddTrailerUrl(this BaseItem item, string url)
{
if (string.IsNullOrEmpty(url))
ArgumentNullException.ThrowIfNull(url, nameof(url));
if (url.Length == 0)
{
throw new ArgumentNullException(nameof(url));
throw new ArgumentException("String can't be empty", nameof(url));
}
var current = item.RemoteTrailers.FirstOrDefault(i => string.Equals(i.Url, url, StringComparison.OrdinalIgnoreCase));

View File

@@ -1,5 +1,3 @@
#nullable disable
using System;
using System.Collections.Generic;
using Jellyfin.Data.Entities;
@@ -50,7 +48,7 @@ namespace MediaBrowser.Controller
/// <param name="itemId">The item id.</param>
/// <param name="client">The client string.</param>
/// <returns>The dictionary of custom item display preferences.</returns>
Dictionary<string, string> ListCustomItemDisplayPreferences(Guid userId, Guid itemId, string client);
Dictionary<string, string?> ListCustomItemDisplayPreferences(Guid userId, Guid itemId, string client);
/// <summary>
/// Sets the custom item display preference for the user and client.
@@ -59,7 +57,7 @@ namespace MediaBrowser.Controller
/// <param name="itemId">The item id.</param>
/// <param name="client">The client id.</param>
/// <param name="customPreferences">A dictionary of custom item display preferences.</param>
void SetCustomItemDisplayPreferences(Guid userId, Guid itemId, string client, Dictionary<string, string> customPreferences);
void SetCustomItemDisplayPreferences(Guid userId, Guid itemId, string client, Dictionary<string, string?> customPreferences);
/// <summary>
/// Saves changes made to the database.