mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-07 19:02:11 +01:00
Merge branch 'master' into network-rewrite
This commit is contained in:
@@ -171,10 +171,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <exception cref="ArgumentNullException">Throws if child is null.</exception>
|
||||
public void AddVirtualChild(BaseItem child)
|
||||
{
|
||||
if (child == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(child));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(child);
|
||||
|
||||
_virtualChildren.Add(child);
|
||||
}
|
||||
|
||||
@@ -1101,10 +1101,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
private MediaSourceInfo GetVersionInfo(bool enablePathSubstitution, BaseItem item, MediaSourceType type)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
|
||||
var protocol = item.PathProtocol;
|
||||
|
||||
@@ -1544,10 +1541,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <exception cref="ArgumentNullException">If user is null.</exception>
|
||||
public bool IsParentalAllowed(User user)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(user);
|
||||
|
||||
if (!IsVisibleViaTags(user))
|
||||
{
|
||||
@@ -1667,10 +1661,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <exception cref="ArgumentNullException"><paramref name="user" /> is <c>null</c>.</exception>
|
||||
public virtual bool IsVisible(User user)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(user);
|
||||
|
||||
return IsParentalAllowed(user);
|
||||
}
|
||||
@@ -1842,10 +1833,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
DateTime? datePlayed,
|
||||
bool resetPosition)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(user);
|
||||
|
||||
var data = UserDataManager.GetUserData(user, this);
|
||||
|
||||
@@ -1876,10 +1864,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <exception cref="ArgumentNullException">Throws if user is null.</exception>
|
||||
public virtual void MarkUnplayed(User user)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(user);
|
||||
|
||||
var data = UserDataManager.GetUserData(user, this);
|
||||
|
||||
@@ -2110,10 +2095,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <returns>Image index.</returns>
|
||||
public int GetImageIndex(ItemImageInfo image)
|
||||
{
|
||||
if (image == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(image));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(image);
|
||||
|
||||
if (image.Type == ImageType.Chapter)
|
||||
{
|
||||
@@ -2320,10 +2302,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public virtual bool IsUnplayed(User user)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(user);
|
||||
|
||||
var userdata = UserDataManager.GetUserData(user, this);
|
||||
|
||||
|
||||
@@ -71,15 +71,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
where T : BaseItem
|
||||
where TU : BaseItem
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(source));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(source);
|
||||
|
||||
if (dest == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(dest));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(dest);
|
||||
|
||||
var destProps = typeof(TU).GetProperties().Where(x => x.CanWrite).ToList();
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <param name="url">Trailer URL.</param>
|
||||
public static void AddTrailerUrl(this BaseItem item, string url)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(url, nameof(url));
|
||||
ArgumentNullException.ThrowIfNull(url);
|
||||
|
||||
if (url.Length == 0)
|
||||
{
|
||||
|
||||
@@ -1023,10 +1023,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
IServerConfigurationManager configurationManager,
|
||||
ICollectionManager collectionManager)
|
||||
{
|
||||
if (items == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(items));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(items);
|
||||
|
||||
if (CollapseBoxSetItems(query, queryParent, user, configurationManager))
|
||||
{
|
||||
@@ -1273,20 +1270,14 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public List<BaseItem> GetChildren(User user, bool includeLinkedChildren)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(user);
|
||||
|
||||
return GetChildren(user, includeLinkedChildren, null);
|
||||
}
|
||||
|
||||
public virtual List<BaseItem> GetChildren(User user, bool includeLinkedChildren, InternalItemsQuery query)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(user);
|
||||
|
||||
// the true root should return our users root folder children
|
||||
if (IsPhysicalRoot)
|
||||
@@ -1367,10 +1358,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public virtual IEnumerable<BaseItem> GetRecursiveChildren(User user, InternalItemsQuery query)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(user);
|
||||
|
||||
var result = new Dictionary<Guid, BaseItem>();
|
||||
|
||||
|
||||
@@ -11,10 +11,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public static void AddPerson(List<PersonInfo> people, PersonInfo person)
|
||||
{
|
||||
if (person == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(person));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(person);
|
||||
|
||||
if (string.IsNullOrEmpty(person.Name))
|
||||
{
|
||||
|
||||
@@ -40,10 +40,7 @@ namespace MediaBrowser.Controller.IO
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
|
||||
if (args == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(args));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(args);
|
||||
|
||||
var entries = directoryService.GetFileSystemEntries(path);
|
||||
|
||||
|
||||
@@ -5105,15 +5105,9 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
MediaSourceInfo mediaSource,
|
||||
string requestedUrl)
|
||||
{
|
||||
if (state == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(state));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(state);
|
||||
|
||||
if (mediaSource == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(mediaSource));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(mediaSource);
|
||||
|
||||
var path = mediaSource.Path;
|
||||
var protocol = mediaSource.Protocol;
|
||||
|
||||
@@ -38,10 +38,7 @@ namespace MediaBrowser.Controller.Net
|
||||
|
||||
protected BasePeriodicWebSocketListener(ILogger<BasePeriodicWebSocketListener<TReturnDataType, TStateType>> logger)
|
||||
{
|
||||
if (logger == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(logger));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(logger);
|
||||
|
||||
Logger = logger;
|
||||
}
|
||||
@@ -77,10 +74,7 @@ namespace MediaBrowser.Controller.Net
|
||||
/// <returns>Task.</returns>
|
||||
public Task ProcessMessageAsync(WebSocketMessageInfo message)
|
||||
{
|
||||
if (message == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(message));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(message);
|
||||
|
||||
if (message.MessageType == StartType)
|
||||
{
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Entities;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace MediaBrowser.Controller.Net
|
||||
{
|
||||
public interface ISessionContext
|
||||
{
|
||||
Task<SessionInfo> GetSession(object requestContext);
|
||||
|
||||
Task<User?> GetUser(object requestContext);
|
||||
|
||||
Task<SessionInfo> GetSession(HttpContext requestContext);
|
||||
|
||||
Task<User?> GetUser(HttpContext requestContext);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user