mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-18 08:06:35 +00:00
Merge branch 'master' into network-rewrite
This commit is contained in:
@@ -210,10 +210,7 @@ namespace Emby.Server.Implementations.AppBase
|
||||
/// <exception cref="ArgumentNullException"><c>newConfiguration</c> is <c>null</c>.</exception>
|
||||
public virtual void ReplaceConfiguration(BaseApplicationConfiguration newConfiguration)
|
||||
{
|
||||
if (newConfiguration == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(newConfiguration));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(newConfiguration);
|
||||
|
||||
ValidateCachePath(newConfiguration);
|
||||
|
||||
|
||||
@@ -630,8 +630,6 @@ namespace Emby.Server.Implementations
|
||||
|
||||
serviceCollection.AddSingleton<IEncodingManager, MediaEncoder.EncodingManager>();
|
||||
|
||||
serviceCollection.AddScoped<ISessionContext, SessionContext>();
|
||||
|
||||
serviceCollection.AddSingleton<IAuthService, AuthService>();
|
||||
serviceCollection.AddSingleton<IQuickConnect, QuickConnectManager>();
|
||||
|
||||
|
||||
@@ -1188,10 +1188,7 @@ namespace Emby.Server.Implementations.Channels
|
||||
|
||||
internal IChannel GetChannelProvider(Channel channel)
|
||||
{
|
||||
if (channel == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(channel));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(channel);
|
||||
|
||||
var result = GetAllChannels()
|
||||
.FirstOrDefault(i => GetInternalChannelId(i.Name).Equals(channel.ChannelId) || string.Equals(i.Name, channel.Name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
@@ -54,10 +54,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public static void RunQueries(this SQLiteDatabaseConnection connection, string[] queries)
|
||||
{
|
||||
if (queries == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(queries));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(queries);
|
||||
|
||||
connection.RunInTransaction(conn =>
|
||||
{
|
||||
|
||||
@@ -583,10 +583,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public void SaveImages(BaseItem item)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
|
||||
CheckDisposed();
|
||||
|
||||
@@ -617,10 +614,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// </exception>
|
||||
public void SaveItems(IEnumerable<BaseItem> items, CancellationToken cancellationToken)
|
||||
{
|
||||
if (items == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(items));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(items);
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
@@ -2085,10 +2079,7 @@ namespace Emby.Server.Implementations.Data
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
}
|
||||
|
||||
if (chapters == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(chapters));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(chapters);
|
||||
|
||||
var idBlob = id.ToByteArray();
|
||||
|
||||
@@ -2557,10 +2548,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public int GetCount(InternalItemsQuery query)
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(query);
|
||||
|
||||
CheckDisposed();
|
||||
|
||||
@@ -2613,10 +2601,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public List<BaseItem> GetItemList(InternalItemsQuery query)
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(query);
|
||||
|
||||
CheckDisposed();
|
||||
|
||||
@@ -2794,10 +2779,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public QueryResult<BaseItem> GetItems(InternalItemsQuery query)
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(query);
|
||||
|
||||
CheckDisposed();
|
||||
|
||||
@@ -3174,10 +3156,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public List<Guid> GetItemIdsList(InternalItemsQuery query)
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(query);
|
||||
|
||||
CheckDisposed();
|
||||
|
||||
@@ -4837,10 +4816,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
|
||||
public List<string> GetPeopleNames(InternalPeopleQuery query)
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(query);
|
||||
|
||||
CheckDisposed();
|
||||
|
||||
@@ -4880,10 +4856,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
|
||||
public List<PersonInfo> GetPeople(InternalPeopleQuery query)
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(query);
|
||||
|
||||
CheckDisposed();
|
||||
|
||||
@@ -4999,10 +4972,7 @@ AND Type = @InternalPersonType)");
|
||||
throw new ArgumentNullException(nameof(itemId));
|
||||
}
|
||||
|
||||
if (ancestorIds == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(ancestorIds));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(ancestorIds);
|
||||
|
||||
CheckDisposed();
|
||||
|
||||
@@ -5175,10 +5145,7 @@ AND Type = @InternalPersonType)");
|
||||
|
||||
private QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetItemValues(InternalItemsQuery query, int[] itemValueTypes, string returnType)
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(query);
|
||||
|
||||
if (!query.Limit.HasValue)
|
||||
{
|
||||
@@ -5531,10 +5498,7 @@ AND Type = @InternalPersonType)");
|
||||
throw new ArgumentNullException(nameof(itemId));
|
||||
}
|
||||
|
||||
if (values == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(values));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(values);
|
||||
|
||||
CheckDisposed();
|
||||
|
||||
@@ -5607,10 +5571,7 @@ AND Type = @InternalPersonType)");
|
||||
throw new ArgumentNullException(nameof(itemId));
|
||||
}
|
||||
|
||||
if (people == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(people));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(people);
|
||||
|
||||
CheckDisposed();
|
||||
|
||||
@@ -5710,10 +5671,7 @@ AND Type = @InternalPersonType)");
|
||||
{
|
||||
CheckDisposed();
|
||||
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(query);
|
||||
|
||||
var cmdText = _mediaStreamSaveColumnsSelectQuery;
|
||||
|
||||
@@ -5766,10 +5724,7 @@ AND Type = @InternalPersonType)");
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
}
|
||||
|
||||
if (streams == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(streams));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(streams);
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
@@ -6107,10 +6062,7 @@ AND Type = @InternalPersonType)");
|
||||
{
|
||||
CheckDisposed();
|
||||
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(query);
|
||||
|
||||
var cmdText = _mediaAttachmentSaveColumnsSelectQuery;
|
||||
|
||||
@@ -6152,10 +6104,7 @@ AND Type = @InternalPersonType)");
|
||||
throw new ArgumentException("Guid can't be empty.", nameof(id));
|
||||
}
|
||||
|
||||
if (attachments == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(attachments));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(attachments);
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
|
||||
@@ -133,10 +133,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// <inheritdoc />
|
||||
public void SaveUserData(long userId, string key, UserItemData userData, CancellationToken cancellationToken)
|
||||
{
|
||||
if (userData == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(userData));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(userData);
|
||||
|
||||
if (userId <= 0)
|
||||
{
|
||||
@@ -154,10 +151,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// <inheritdoc />
|
||||
public void SaveAllUserData(long userId, UserItemData[] userData, CancellationToken cancellationToken)
|
||||
{
|
||||
if (userData == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(userData));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(userData);
|
||||
|
||||
if (userId <= 0)
|
||||
{
|
||||
@@ -304,10 +298,7 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
public UserItemData GetUserData(long userId, List<string> keys)
|
||||
{
|
||||
if (keys == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(keys));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(keys);
|
||||
|
||||
if (keys.Count == 0)
|
||||
{
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Entities;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Emby.Server.Implementations.HttpServer.Security
|
||||
{
|
||||
public class SessionContext : ISessionContext
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ISessionManager _sessionManager;
|
||||
private readonly IAuthorizationContext _authContext;
|
||||
|
||||
public SessionContext(IUserManager userManager, IAuthorizationContext authContext, ISessionManager sessionManager)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_authContext = authContext;
|
||||
_sessionManager = sessionManager;
|
||||
}
|
||||
|
||||
public async Task<SessionInfo> GetSession(HttpContext requestContext)
|
||||
{
|
||||
var authorization = await _authContext.GetAuthorizationInfo(requestContext).ConfigureAwait(false);
|
||||
|
||||
var user = authorization.User;
|
||||
return await _sessionManager.LogSessionActivity(
|
||||
authorization.Client,
|
||||
authorization.Version,
|
||||
authorization.DeviceId,
|
||||
authorization.Device,
|
||||
requestContext.GetNormalizedRemoteIp().ToString(),
|
||||
user).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public Task<SessionInfo> GetSession(object requestContext)
|
||||
{
|
||||
return GetSession((HttpContext)requestContext);
|
||||
}
|
||||
|
||||
public async Task<User?> GetUser(HttpContext requestContext)
|
||||
{
|
||||
var session = await GetSession(requestContext).ConfigureAwait(false);
|
||||
|
||||
return session.UserId.Equals(default)
|
||||
? null
|
||||
: _userManager.GetUserById(session.UserId);
|
||||
}
|
||||
|
||||
public Task<User?> GetUser(object requestContext)
|
||||
{
|
||||
return GetUser(((HttpRequest)requestContext).HttpContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,6 +93,7 @@ namespace Emby.Server.Implementations.Images
|
||||
returnItems.Shuffle();
|
||||
return returnItems;
|
||||
}
|
||||
|
||||
returnItems = items
|
||||
.Where(i => i.HasImage(ImageType.Primary))
|
||||
.ToList();
|
||||
|
||||
@@ -281,10 +281,7 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
public void RegisterItem(BaseItem item)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
|
||||
if (item is IItemByName)
|
||||
{
|
||||
@@ -311,10 +308,7 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
public void DeleteItem(BaseItem item, DeleteOptions options, bool notifyParentItem)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
|
||||
var parent = item.GetOwner() ?? item.GetParent();
|
||||
|
||||
@@ -323,10 +317,7 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
public void DeleteItem(BaseItem item, DeleteOptions options, BaseItem parent, bool notifyParentItem)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
|
||||
if (item.SourceType == SourceType.Channel)
|
||||
{
|
||||
@@ -509,10 +500,7 @@ namespace Emby.Server.Implementations.Library
|
||||
throw new ArgumentNullException(nameof(key));
|
||||
}
|
||||
|
||||
if (type == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(type));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(type);
|
||||
|
||||
string programDataPath = _configurationManager.ApplicationPaths.ProgramDataPath;
|
||||
if (key.StartsWith(programDataPath, StringComparison.Ordinal))
|
||||
@@ -544,10 +532,7 @@ namespace Emby.Server.Implementations.Library
|
||||
string collectionType = null,
|
||||
LibraryOptions libraryOptions = null)
|
||||
{
|
||||
if (fileInfo == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(fileInfo));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(fileInfo);
|
||||
|
||||
var fullPath = fileInfo.FullName;
|
||||
|
||||
@@ -1854,10 +1839,7 @@ namespace Emby.Server.Implementations.Library
|
||||
/// <inheritdoc />
|
||||
public async Task UpdateImagesAsync(BaseItem item, bool forceUpdate = false)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
|
||||
var outdated = forceUpdate
|
||||
? item.ImageInfos.Where(i => i.Path != null).ToArray()
|
||||
@@ -2296,10 +2278,7 @@ namespace Emby.Server.Implementations.Library
|
||||
string viewType,
|
||||
string sortName)
|
||||
{
|
||||
if (parent == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(parent));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(parent);
|
||||
|
||||
var name = parent.Name;
|
||||
var parentId = parent.Id;
|
||||
@@ -2779,7 +2758,7 @@ namespace Emby.Server.Implementations.Library
|
||||
}
|
||||
})
|
||||
.Where(i => i != null)
|
||||
.Where(i => query.User == null ?
|
||||
.Where(i => query.User == null ?
|
||||
true :
|
||||
i.IsVisible(query.User))
|
||||
.ToList();
|
||||
@@ -2983,10 +2962,7 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
private void AddMediaPathInternal(string virtualFolderName, MediaPathInfo pathInfo, bool saveLibraryOptions)
|
||||
{
|
||||
if (pathInfo == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(pathInfo));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(pathInfo);
|
||||
|
||||
var path = pathInfo.Path;
|
||||
|
||||
@@ -3033,10 +3009,7 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
public void UpdateMediaPath(string virtualFolderName, MediaPathInfo mediaPath)
|
||||
{
|
||||
if (mediaPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(mediaPath));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(mediaPath);
|
||||
|
||||
var rootFolderPath = _configurationManager.ApplicationPaths.DefaultUserViewsPath;
|
||||
var virtualFolderPath = Path.Combine(rootFolderPath, virtualFolderName);
|
||||
|
||||
@@ -322,10 +322,7 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
public List<MediaSourceInfo> GetStaticMediaSources(BaseItem item, bool enablePathSubstitution, User user = null)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
|
||||
var hasMediaSources = (IHasMediaSources)item;
|
||||
|
||||
|
||||
@@ -91,10 +91,7 @@ namespace Emby.Server.Implementations.Library.Resolvers
|
||||
|
||||
internal static bool IsImageFile(string path, IImageProcessor imageProcessor)
|
||||
{
|
||||
if (path == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(path);
|
||||
|
||||
var filename = Path.GetFileNameWithoutExtension(path);
|
||||
|
||||
|
||||
@@ -53,15 +53,9 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
public void SaveUserData(User user, BaseItem item, UserItemData userData, UserDataSaveReason reason, CancellationToken cancellationToken)
|
||||
{
|
||||
if (userData == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(userData));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(userData);
|
||||
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
@@ -194,10 +188,7 @@ namespace Emby.Server.Implementations.Library
|
||||
/// <exception cref="ArgumentNullException"><paramref name="data"/> is <c>null</c>.</exception>
|
||||
private UserItemDataDto GetUserItemDataDto(UserItemData data)
|
||||
{
|
||||
if (data == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(data));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(data);
|
||||
|
||||
return new UserItemDataDto
|
||||
{
|
||||
|
||||
@@ -1223,10 +1223,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||
|
||||
private async Task RecordStream(TimerInfo timer, DateTime recordingEndDate, ActiveRecordingInfo activeRecordingInfo)
|
||||
{
|
||||
if (timer == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(timer));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(timer);
|
||||
|
||||
LiveTvProgram programInfo = null;
|
||||
|
||||
@@ -2347,10 +2344,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||
|
||||
private IEnumerable<TimerInfo> GetTimersForSeries(SeriesTimerInfo seriesTimer)
|
||||
{
|
||||
if (seriesTimer == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(seriesTimer));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(seriesTimer);
|
||||
|
||||
var query = new InternalItemsQuery
|
||||
{
|
||||
|
||||
@@ -84,10 +84,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||
|
||||
public virtual void Update(T item)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
|
||||
lock (_fileDataLock)
|
||||
{
|
||||
@@ -107,10 +104,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||
|
||||
public virtual void Add(T item)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
|
||||
lock (_fileDataLock)
|
||||
{
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using System.Text;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
|
||||
namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||
{
|
||||
@@ -56,7 +56,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||
}
|
||||
|
||||
tmpName += " " + info.EpisodeTitle;
|
||||
// Since the filename will be used with file ext. (.mp4, .ts, etc)
|
||||
// Since the filename will be used with file ext. (.mp4, .ts, etc)
|
||||
if (Encoding.UTF8.GetByteCount(tmpName) < 250)
|
||||
{
|
||||
name = tmpName;
|
||||
|
||||
@@ -44,10 +44,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
||||
|
||||
public async Task<Stream> GetListingsStream(TunerHostInfo info, CancellationToken cancellationToken)
|
||||
{
|
||||
if (info == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(info));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(info);
|
||||
|
||||
if (!info.Url.StartsWith("http", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
"AppDeviceValues": "앱: {0}, 장치: {1}",
|
||||
"Application": "애플리케이션",
|
||||
"Artists": "아티스트",
|
||||
"AuthenticationSucceededWithUserName": "{0}이 성공적으로 인증됨",
|
||||
"AuthenticationSucceededWithUserName": "{0}이(가) 성공적으로 인증됨",
|
||||
"Books": "도서",
|
||||
"CameraImageUploadedFrom": "{0}에서 새로운 카메라 이미지가 업로드됨",
|
||||
"Channels": "채널",
|
||||
"ChapterNameValue": "챕터 {0}",
|
||||
"Collections": "컬렉션",
|
||||
"DeviceOfflineWithName": "{0}의 연결 끊김",
|
||||
"DeviceOnlineWithName": "{0}이 연결됨",
|
||||
"DeviceOnlineWithName": "{0}이(가) 연결됨",
|
||||
"FailedLoginAttemptWithUserName": "{0}에서 로그인 실패",
|
||||
"Favorites": "즐겨찾기",
|
||||
"Folders": "폴더",
|
||||
|
||||
@@ -14,5 +14,111 @@
|
||||
"HeaderLiveTV": "تور تېلېۋىزىيەسى",
|
||||
"Default": "سۈكۈتتىكى",
|
||||
"Folders": "ھۆججەت خالتىسى",
|
||||
"Favorites": "ساقلىغۇچ"
|
||||
"Favorites": "ساقلىغۇچ",
|
||||
"LabelRunningTimeValue": "ئىجرا بولغان ۋاقتى:{0}",
|
||||
"HeaderRecordingGroups": "خاتىرلەش گۇرۇپىسى",
|
||||
"Forced": "ئەڭ",
|
||||
"TaskKeyframeExtractor": "ھالقىلىق رامكا ئاجراتقۇچ",
|
||||
"TaskKeyframeExtractorDescription": "سىن ھۆججەتلىرىدىن رامكا ئاجرىتىپ، تېخىمۇ ئېنىق بولغان HLS قويۇلۇش تىزىملىكىنى قۇرۇلىدۇ. بۇ ۋەزىپە ئۇزۇن داۋام قىلىشى مۇمكىن.",
|
||||
"TaskOptimizeDatabase": "سانداننى ئەلالاشتۇرۇش",
|
||||
"TaskDownloadMissingSubtitlesDescription": "ئامىللار تەڭشىكىگە ئاساسەن توردىن كەم بولغان فىلىم خېتىنى ئىزدەش.",
|
||||
"TaskDownloadMissingSubtitles": "كەم بولغان فىلىم خەتلىرىنى چۈشۈرۈش",
|
||||
"TasksChannelsCategory": "ئىنتېرنېت قاناللىرى",
|
||||
"TaskRefreshChannelsDescription": "ئىنتېرنېت قانىلى ئۇچۇرىنى يېڭىلاش.",
|
||||
"TaskRefreshChannels": "قانالنى يېڭىلاش",
|
||||
"TaskCleanTranscodeDescription": "بىر كۈندىن ئاشقان ئالماشتۇرۇش ھۆججەتلىرىنى ئۆچۈرۈش.",
|
||||
"TaskCleanTranscode": "ئايلاندۇرۇش ھۆججەت قىسقۇچىنى تازىلاش",
|
||||
"TaskUpdatePluginsDescription": "ئاپتوماتىك يېڭىلاشقا بېكىتىلگەن قىستۇرمىلارنىڭ يېڭىلانمىسىنى چۈشۈرۈش ۋە قاچىلاش.",
|
||||
"TaskUpdatePlugins": "قىستۇرمىلارنى يېڭىلاش",
|
||||
"TaskRefreshPeopleDescription": "مېدىيا ئامبىرىدىكى ئارتىس ۋە رېژىسسورلارنىڭ ئۇچۇرىنى يېڭىلاش.",
|
||||
"TaskRefreshPeople": "ئابونتلارنى يېڭىلاش",
|
||||
"TaskCleanLogsDescription": "{0} كۈندىن ئاشقان Log ھۆججىتىنى ئۆچۈرۈش.",
|
||||
"TaskCleanLogs": "Log ھۆججەت قسقۇچىنى تازىلاش",
|
||||
"TaskRefreshLibraryDescription": "مېدىيا ئامبىرىغا قوشۇلغان يېڭى ھۆججەتلەرنى ئىزدەش ۋە مېدىيا ئۇچۇرلىرىنى يېڭىلاش.",
|
||||
"TaskRefreshLibrary": "مېدىيا ئامبىرىنى سىكاننېرلاش",
|
||||
"TaskRefreshChapterImagesDescription": "ۋېدىئو بۆلەكلىرى ئۈچۈن كىچىك سۈرەت ياساش.",
|
||||
"TaskRefreshChapterImages": "بۆلەكلەر رەسىملىرىنى چىقىرىۋېلىش",
|
||||
"TaskCleanCacheDescription": "سىستېما ئىھتىياجى يوق بولغان ۋاقىتلىق ھۆججەتلەرنى ئۆچۈرۈش.",
|
||||
"TaskCleanCache": "ۋاقىتلىق ھۆججەت قىسقۇچنى تازىلاش",
|
||||
"TaskCleanActivityLogDescription": "ۋاقىت تەڭشىكىدىن بۇرۇنقى پائالىيەت خاتىرىسى خاتىرىسىنى ئۆچۈرۈش.",
|
||||
"TaskCleanActivityLog": "پروگرامما خاتىرىسىنى تازىلاش",
|
||||
"TasksApplicationCategory": "پروگرامما",
|
||||
"TasksLibraryCategory": "مېدىيا ئامبىرى",
|
||||
"TasksMaintenanceCategory": "ئاسراش",
|
||||
"VersionNumber": "نەشرى {0}",
|
||||
"ValueSpecialEpisodeName": "خاسلىق - {0}",
|
||||
"ValueHasBeenAddedToLibrary": "{0} مېدىيا ئامبىرىڭىزغا قوشۇلدى",
|
||||
"UserStoppedPlayingItemWithValues": "{0}،{1} نى {2} دە قويۇنشتىن توختىدى",
|
||||
"UserStartedPlayingItemWithValues": "{0}،{1} نى {2} دە قويۇۋاتىدۇ",
|
||||
"UserPolicyUpdatedWithName": "ئابونتلار سىياسىتى {0} غا يېڭىلاندى",
|
||||
"UserPasswordChangedWithName": "ئابونت{0} ئۈچۈن پارول ئۆزگەرتىلدى",
|
||||
"UserOfflineFromDevice": "{0} بىلەن {1} نىڭ ئالاقىسى ئۈزۈلدى",
|
||||
"UserLockedOutWithName": "ئابونت {0} قۇلۇپلاندى",
|
||||
"UserDownloadingItemWithValues": "{0} چۈشۈرۈۋاتىدۇ {1}",
|
||||
"UserDeletedWithName": "{0} ئابونت ئۆچۈرۈلدى",
|
||||
"UserCreatedWithName": "{0} ئابونت يېڭىدىن قوشۇلدى",
|
||||
"User": "ئابونت",
|
||||
"Undefined": "بېكىتىلمىگەن",
|
||||
"TvShows": "تىياتىرلار",
|
||||
"System": "سىستېما",
|
||||
"Sync": "ماس قەدەمدەش",
|
||||
"SubtitleDownloadFailureFromForItem": "{0} دىن {0} نىڭ فىلىم خېتىنى چۈشۈرگىلى بولمىدى",
|
||||
"StartupEmbyServerIsLoading": "Jellyfin مۇلازىمىتېرى يۈكلىنىۋاتىدۇ. سەل تۇرۇپ قايتا سىناڭ.",
|
||||
"Songs": "ناخشىلار",
|
||||
"Shows": "پروگراممىلار",
|
||||
"ServerNameNeedsToBeRestarted": "{0} قايتا قوزغىتىلىشى كېرەك",
|
||||
"ScheduledTaskStartedWithName": "{0} باشلاندى",
|
||||
"ScheduledTaskFailedWithName": "{0} مەغلۇپ بولدى",
|
||||
"ProviderValue": "تەمىنلىگۈچى: {0}",
|
||||
"PluginUpdatedWithName": "{0} يېڭىلاندى",
|
||||
"PluginUninstalledWithName": "{0} ئۆچۈرۈلدى",
|
||||
"PluginInstalledWithName": "{0} قاچىلاندى",
|
||||
"Plugin": "قىستۇرما",
|
||||
"Playlists": "قويۇش تىزىملىكى",
|
||||
"Photos": "رەسىملەر",
|
||||
"NotificationOptionVideoPlaybackStopped": "سىن قويۇلۇش توختىدى",
|
||||
"NotificationOptionVideoPlayback": "سىن قويۇلدى",
|
||||
"NotificationOptionUserLockedOut": "ئابونت قۇلۇپلاندى",
|
||||
"NotificationOptionTaskFailed": "بەلگىلەنگەن ۋەزىپە مەغلۇپ بولدى",
|
||||
"NotificationOptionServerRestartRequired": "مۇلازىمىتېر قايتا قوزغىتىلىشى كېرەك",
|
||||
"NotificationOptionPluginUpdateInstalled": "قىستۇرما يېڭىلانمىسى قاچىلاندى",
|
||||
"NotificationOptionPluginInstalled": "قىستۇرما قاچىلاندى",
|
||||
"NotificationOptionPluginUninstalled": "قىستۇرما ئۆچۈرۈلدى",
|
||||
"NotificationOptionPluginError": "قىستۇرما خاتالىقى",
|
||||
"NotificationOptionNewLibraryContent": "يېڭى مەزمۇن قوشۇلدى",
|
||||
"NotificationOptionInstallationFailed": "قاچىلاش مەغلۇب بولدى",
|
||||
"NotificationOptionCameraImageUploaded": "كامىكامېرا سۈرىتى يوللاندى",
|
||||
"NotificationOptionAudioPlayback": "ئاۋاز قويۇش باشلاندى",
|
||||
"NotificationOptionAudioPlaybackStopped": "ئاۋاز قويۇش توختىدى",
|
||||
"NotificationOptionApplicationUpdateInstalled": "ئەپ يېڭىلانمىسى ئورنىتىلدى",
|
||||
"NotificationOptionApplicationUpdateAvailable": "ئەپنىڭ نەشرىنى يېڭىلىغىلى بولۇدۇ",
|
||||
"NewVersionIsAvailable": "Jellyfin Server نىڭ يېڭى نۇسخىسىنى چۈشۈرگىلى بولىدۇ.",
|
||||
"NameSeasonUnknown": "نامەمۇم بۆلۈم",
|
||||
"NameSeasonNumber": "{0}-بۆلۈم",
|
||||
"NameInstallFailed": "{0} قاچىلاش مەغلۇپ بولدى",
|
||||
"MusicVideos": "سىنلىق مۇزىكا",
|
||||
"Music": "مۇزىكا",
|
||||
"Movies": "فىلىملەر",
|
||||
"MixedContent": "ئارىلاشما مەزمۇن",
|
||||
"MessageNamedServerConfigurationUpdatedWithValue": "مۇلازىمىتېر تەڭشىكىنىڭ {0} قىسمى يېڭىلىنىپ بولدى",
|
||||
"MessageServerConfigurationUpdated": "مۇلازىمىتېر يېڭىلىنىپ بولدى",
|
||||
"MessageApplicationUpdated": "Jellyfin مۇلازىمىتېرى يېڭىلاندى",
|
||||
"MessageApplicationUpdatedTo": "Jellyfin مۇلازىمىتېر نەشرى {0} گە يېڭىلاندى",
|
||||
"Latest": "ئەڭ يېڭى",
|
||||
"LabelIpAddressValue": "{0}: IP ئادرىسى",
|
||||
"ItemRemovedWithName": "{0} ئامباردىن چىقىرىلدى",
|
||||
"ItemAddedWithName": "{0} ئامبارغا قوشۇلدى",
|
||||
"Inherit": "داۋاملاشتۇرۇش",
|
||||
"HomeVideos": "ئائىلە سىنلىرى",
|
||||
"HeaderNextUp": "كېيىنكىسى",
|
||||
"HeaderFavoriteSongs": "ئەڭ ياقتۇرىدىغان ناخشىلار",
|
||||
"HeaderFavoriteShows": "ئەڭ ياقتۇرىدىغان پروگراممىلار",
|
||||
"HeaderFavoriteEpisodes": "ئەڭ ياقتۇرىدىغان تىياتېرلار",
|
||||
"HeaderFavoriteArtists": "ئەڭ ياقتۇرىدىغان سەنئەتكارلار",
|
||||
"HeaderFavoriteAlbums": "ياقتۇرىدىغان پىلاستىنكىلار",
|
||||
"HeaderContinueWatching": "داۋاملىق كۆرۈش",
|
||||
"HeaderAlbumArtists": "پىلاستىنكا سەنئەتكارلىرى",
|
||||
"Genres": "ئۇسلۇبلار",
|
||||
"FailedLoginAttemptWithUserName": "{0} كىرىش ئوڭۇشلۇق بولمىدى",
|
||||
"External": "سىرتقى"
|
||||
}
|
||||
|
||||
@@ -63,10 +63,7 @@ namespace Emby.Server.Implementations.Net
|
||||
/// <inheritdoc />
|
||||
public ISocket CreateUdpMulticastSocket(IPAddress ipAddress, IPAddress bindIpAddress, int multicastTimeToLive, int localPort)
|
||||
{
|
||||
if (ipAddress == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(ipAddress));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(ipAddress);
|
||||
|
||||
if (bindIpAddress == null)
|
||||
{
|
||||
|
||||
@@ -35,10 +35,7 @@ namespace Emby.Server.Implementations.Net
|
||||
|
||||
public UdpSocket(Socket socket, int localPort, IPAddress ip)
|
||||
{
|
||||
if (socket == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(socket));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(socket);
|
||||
|
||||
_socket = socket;
|
||||
_localPort = localPort;
|
||||
@@ -51,10 +48,7 @@ namespace Emby.Server.Implementations.Net
|
||||
|
||||
public UdpSocket(Socket socket, IPEndPoint endPoint)
|
||||
{
|
||||
if (socket == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(socket));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(socket);
|
||||
|
||||
_socket = socket;
|
||||
_socket.Connect(endPoint);
|
||||
|
||||
@@ -234,10 +234,7 @@ namespace Emby.Server.Implementations.Plugins
|
||||
/// <returns>Outcome of the operation.</returns>
|
||||
public bool RemovePlugin(LocalPlugin plugin)
|
||||
{
|
||||
if (plugin == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(plugin));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(plugin);
|
||||
|
||||
if (DeletePlugin(plugin))
|
||||
{
|
||||
@@ -288,10 +285,7 @@ namespace Emby.Server.Implementations.Plugins
|
||||
/// <param name="plugin">The <see cref="LocalPlugin"/> of the plug to disable.</param>
|
||||
public void EnablePlugin(LocalPlugin plugin)
|
||||
{
|
||||
if (plugin == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(plugin));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(plugin);
|
||||
|
||||
if (ChangePluginState(plugin, PluginStatus.Active))
|
||||
{
|
||||
@@ -306,10 +300,7 @@ namespace Emby.Server.Implementations.Plugins
|
||||
/// <param name="plugin">The <see cref="LocalPlugin"/> of the plug to disable.</param>
|
||||
public void DisablePlugin(LocalPlugin plugin)
|
||||
{
|
||||
if (plugin == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(plugin));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(plugin);
|
||||
|
||||
// Update the manifest on disk
|
||||
if (ChangePluginState(plugin, PluginStatus.Disabled))
|
||||
@@ -326,10 +317,7 @@ namespace Emby.Server.Implementations.Plugins
|
||||
public void FailPlugin(Assembly assembly)
|
||||
{
|
||||
// Only save if disabled.
|
||||
if (assembly == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(assembly));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(assembly);
|
||||
|
||||
var plugin = _plugins.FirstOrDefault(p => p.DllFiles.Contains(assembly.Location));
|
||||
if (plugin == null)
|
||||
|
||||
@@ -92,25 +92,13 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// </exception>
|
||||
public ScheduledTaskWorker(IScheduledTask scheduledTask, IApplicationPaths applicationPaths, ITaskManager taskManager, ILogger logger)
|
||||
{
|
||||
if (scheduledTask == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scheduledTask));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(scheduledTask);
|
||||
|
||||
if (applicationPaths == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(applicationPaths));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(applicationPaths);
|
||||
|
||||
if (taskManager == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(taskManager));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(taskManager);
|
||||
|
||||
if (logger == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(logger));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(logger);
|
||||
|
||||
ScheduledTask = scheduledTask;
|
||||
_applicationPaths = applicationPaths;
|
||||
@@ -249,10 +237,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
get => _triggers;
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(value));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(value);
|
||||
|
||||
// Cleanup current triggers
|
||||
if (_triggers != null)
|
||||
@@ -281,10 +266,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(value));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(value);
|
||||
|
||||
// This null check is not great, but is needed to handle bad user input, or user mucking with the config file incorrectly
|
||||
var triggerList = value.Where(i => i != null).ToArray();
|
||||
|
||||
@@ -665,10 +665,7 @@ namespace Emby.Server.Implementations.Session
|
||||
{
|
||||
CheckDisposed();
|
||||
|
||||
if (info == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(info));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(info);
|
||||
|
||||
var session = GetSession(info.SessionId);
|
||||
|
||||
@@ -762,10 +759,7 @@ namespace Emby.Server.Implementations.Session
|
||||
{
|
||||
CheckDisposed();
|
||||
|
||||
if (info == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(info));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(info);
|
||||
|
||||
var session = GetSession(info.SessionId);
|
||||
|
||||
@@ -897,10 +891,7 @@ namespace Emby.Server.Implementations.Session
|
||||
{
|
||||
CheckDisposed();
|
||||
|
||||
if (info == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(info));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(info);
|
||||
|
||||
if (info.PositionTicks.HasValue && info.PositionTicks.Value < 0)
|
||||
{
|
||||
@@ -1341,15 +1332,9 @@ namespace Emby.Server.Implementations.Session
|
||||
|
||||
private static void AssertCanControl(SessionInfo session, SessionInfo controllingSession)
|
||||
{
|
||||
if (session == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(session));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(session);
|
||||
|
||||
if (controllingSession == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(controllingSession));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(controllingSession);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1688,10 +1673,7 @@ namespace Emby.Server.Implementations.Session
|
||||
/// </summary>
|
||||
private BaseItemDto GetItemInfo(BaseItem item, MediaSourceInfo mediaSource)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
|
||||
var dtoOptions = _itemInfoDtoOptions;
|
||||
|
||||
@@ -1802,10 +1784,7 @@ namespace Emby.Server.Implementations.Session
|
||||
/// <inheritdoc />
|
||||
public Task<SessionInfo> GetSessionByAuthenticationToken(Device info, string deviceId, string remoteEndpoint, string appVersion)
|
||||
{
|
||||
if (info == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(info));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(info);
|
||||
|
||||
var user = info.UserId.Equals(default)
|
||||
? null
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Linq;
|
||||
using System.Net.WebSockets;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Api.Extensions;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Net;
|
||||
@@ -53,7 +54,6 @@ namespace Emby.Server.Implementations.Session
|
||||
private readonly ISessionManager _sessionManager;
|
||||
private readonly ILogger<SessionWebSocketListener> _logger;
|
||||
private readonly ILoggerFactory _loggerFactory;
|
||||
private readonly IAuthorizationContext _authorizationContext;
|
||||
|
||||
/// <summary>
|
||||
/// The KeepAlive cancellation token.
|
||||
@@ -66,17 +66,14 @@ namespace Emby.Server.Implementations.Session
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="sessionManager">The session manager.</param>
|
||||
/// <param name="loggerFactory">The logger factory.</param>
|
||||
/// <param name="authorizationContext">The authorization context.</param>
|
||||
public SessionWebSocketListener(
|
||||
ILogger<SessionWebSocketListener> logger,
|
||||
ISessionManager sessionManager,
|
||||
ILoggerFactory loggerFactory,
|
||||
IAuthorizationContext authorizationContext)
|
||||
ILoggerFactory loggerFactory)
|
||||
{
|
||||
_logger = logger;
|
||||
_sessionManager = sessionManager;
|
||||
_loggerFactory = loggerFactory;
|
||||
_authorizationContext = authorizationContext;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -110,21 +107,18 @@ namespace Emby.Server.Implementations.Session
|
||||
|
||||
private async Task<SessionInfo> GetSession(HttpContext httpContext, string remoteEndpoint)
|
||||
{
|
||||
var authorizationInfo = await _authorizationContext.GetAuthorizationInfo(httpContext)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
if (!authorizationInfo.IsAuthenticated)
|
||||
if (!httpContext.User.Identity?.IsAuthenticated ?? false)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var deviceId = authorizationInfo.DeviceId;
|
||||
var deviceId = httpContext.User.GetDeviceId();
|
||||
if (httpContext.Request.Query.TryGetValue("deviceId", out var queryDeviceId))
|
||||
{
|
||||
deviceId = queryDeviceId;
|
||||
}
|
||||
|
||||
return await _sessionManager.GetSessionByAuthenticationToken(authorizationInfo.Token, deviceId, remoteEndpoint)
|
||||
return await _sessionManager.GetSessionByAuthenticationToken(httpContext.User.GetToken(), deviceId, remoteEndpoint)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,15 +24,9 @@ namespace Emby.Server.Implementations.Sorting
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem? x, BaseItem? y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(x));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(x);
|
||||
|
||||
if (y == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(y));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(y);
|
||||
|
||||
var episode1 = x as Episode;
|
||||
var episode2 = y as Episode;
|
||||
|
||||
@@ -23,15 +23,9 @@ namespace Emby.Server.Implementations.Sorting
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem? x, BaseItem? y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(x));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(x);
|
||||
|
||||
if (y == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(y));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(y);
|
||||
|
||||
return (x.CommunityRating ?? 0).CompareTo(y.CommunityRating ?? 0);
|
||||
}
|
||||
|
||||
@@ -24,15 +24,9 @@ namespace Emby.Server.Implementations.Sorting
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem? x, BaseItem? y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(x));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(x);
|
||||
|
||||
if (y == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(y));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(y);
|
||||
|
||||
return DateTime.Compare(x.DateCreated, y.DateCreated);
|
||||
}
|
||||
|
||||
@@ -24,15 +24,9 @@ namespace Emby.Server.Implementations.Sorting
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem? x, BaseItem? y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(x));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(x);
|
||||
|
||||
if (y == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(y));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(y);
|
||||
|
||||
if (!x.IndexNumber.HasValue && !y.IndexNumber.HasValue)
|
||||
{
|
||||
|
||||
@@ -24,15 +24,9 @@ namespace Emby.Server.Implementations.Sorting
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem? x, BaseItem? y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(x));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(x);
|
||||
|
||||
if (y == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(y));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(y);
|
||||
|
||||
return string.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
@@ -31,15 +31,9 @@ namespace Emby.Server.Implementations.Sorting
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem? x, BaseItem? y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(x));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(x);
|
||||
|
||||
if (y == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(y));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(y);
|
||||
|
||||
var levelX = string.IsNullOrEmpty(x.OfficialRating) ? 0 : _localization.GetRatingLevel(x.OfficialRating) ?? 0;
|
||||
var levelY = string.IsNullOrEmpty(y.OfficialRating) ? 0 : _localization.GetRatingLevel(y.OfficialRating) ?? 0;
|
||||
|
||||
@@ -24,15 +24,9 @@ namespace Emby.Server.Implementations.Sorting
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem? x, BaseItem? y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(x));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(x);
|
||||
|
||||
if (y == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(y));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(y);
|
||||
|
||||
if (!x.ParentIndexNumber.HasValue && !y.ParentIndexNumber.HasValue)
|
||||
{
|
||||
|
||||
@@ -26,15 +26,9 @@ namespace Emby.Server.Implementations.Sorting
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem x, BaseItem y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(x));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(x);
|
||||
|
||||
if (y == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(y));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(y);
|
||||
|
||||
return (x.RunTimeTicks ?? 0).CompareTo(y.RunTimeTicks ?? 0);
|
||||
}
|
||||
|
||||
@@ -26,15 +26,9 @@ namespace Emby.Server.Implementations.Sorting
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem x, BaseItem y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(x));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(x);
|
||||
|
||||
if (y == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(y));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(y);
|
||||
|
||||
return string.Compare(x.SortName, y.SortName, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
@@ -26,15 +26,9 @@ namespace Emby.Server.Implementations.Sorting
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem x, BaseItem y)
|
||||
{
|
||||
if (x == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(x));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(x);
|
||||
|
||||
if (y == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(y));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(y);
|
||||
|
||||
return AlphanumericComparator.CompareValues(x.Studios.FirstOrDefault(), y.Studios.FirstOrDefault());
|
||||
}
|
||||
|
||||
@@ -294,10 +294,7 @@ namespace Emby.Server.Implementations.Updates
|
||||
/// <inheritdoc />
|
||||
public async Task InstallPackage(InstallationInfo package, CancellationToken cancellationToken)
|
||||
{
|
||||
if (package == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(package));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(package);
|
||||
|
||||
var innerCancellationTokenSource = new CancellationTokenSource();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user