mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 11:57:55 +02:00
Merge pull request #6651 from KonH/fix_common_warnings
This commit is contained in:
commit
9718c0b2ee
41 changed files with 43 additions and 71 deletions
|
@ -51,7 +51,7 @@ namespace Jellyfin.Api.Auth.SyncPlayAccessPolicy
|
||||||
{
|
{
|
||||||
if (user.SyncPlayAccess == SyncPlayUserAccessType.CreateAndJoinGroups
|
if (user.SyncPlayAccess == SyncPlayUserAccessType.CreateAndJoinGroups
|
||||||
|| user.SyncPlayAccess == SyncPlayUserAccessType.JoinGroups
|
|| user.SyncPlayAccess == SyncPlayUserAccessType.JoinGroups
|
||||||
|| _syncPlayManager.IsUserActive(userId!.Value))
|
|| _syncPlayManager.IsUserActive(userId.Value))
|
||||||
{
|
{
|
||||||
context.Succeed(requirement);
|
context.Succeed(requirement);
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ namespace Jellyfin.Api.Auth.SyncPlayAccessPolicy
|
||||||
}
|
}
|
||||||
else if (requirement.RequiredAccess == SyncPlayAccessRequirementType.IsInGroup)
|
else if (requirement.RequiredAccess == SyncPlayAccessRequirementType.IsInGroup)
|
||||||
{
|
{
|
||||||
if (_syncPlayManager.IsUserActive(userId!.Value))
|
if (_syncPlayManager.IsUserActive(userId.Value))
|
||||||
{
|
{
|
||||||
context.Succeed(requirement);
|
context.Succeed(requirement);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
if (enableInMainMenu.HasValue)
|
if (enableInMainMenu.HasValue)
|
||||||
{
|
{
|
||||||
configPages = configPages.Where(p => p!.EnableInMainMenu == enableInMainMenu.Value).ToList();
|
configPages = configPages.Where(p => p.EnableInMainMenu == enableInMainMenu.Value).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return configPages;
|
return configPages;
|
||||||
|
|
|
@ -137,7 +137,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
var existingDisplayPreferences = _displayPreferencesManager.GetDisplayPreferences(userId, itemId, client);
|
var existingDisplayPreferences = _displayPreferencesManager.GetDisplayPreferences(userId, itemId, client);
|
||||||
existingDisplayPreferences.IndexBy = Enum.TryParse<IndexingKind>(displayPreferences.IndexBy, true, out var indexBy) ? indexBy : (IndexingKind?)null;
|
existingDisplayPreferences.IndexBy = Enum.TryParse<IndexingKind>(displayPreferences.IndexBy, true, out var indexBy) ? indexBy : null;
|
||||||
existingDisplayPreferences.ShowBackdrop = displayPreferences.ShowBackdrop;
|
existingDisplayPreferences.ShowBackdrop = displayPreferences.ShowBackdrop;
|
||||||
existingDisplayPreferences.ShowSidebar = displayPreferences.ShowSidebar;
|
existingDisplayPreferences.ShowSidebar = displayPreferences.ShowSidebar;
|
||||||
|
|
||||||
|
|
|
@ -1709,7 +1709,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
});
|
});
|
||||||
|
|
||||||
return FileStreamResponseHelpers.GetStaticFileResult(segmentPath, MimeTypes.GetMimeType(segmentPath)!, false, HttpContext);
|
return FileStreamResponseHelpers.GetStaticFileResult(segmentPath, MimeTypes.GetMimeType(segmentPath), false, HttpContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
private long GetEndPositionTicks(StreamState state, int requestedIndex)
|
private long GetEndPositionTicks(StreamState state, int requestedIndex)
|
||||||
|
|
|
@ -69,7 +69,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
return BadRequest("Invalid segment.");
|
return BadRequest("Invalid segment.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return FileStreamResponseHelpers.GetStaticFileResult(file, MimeTypes.GetMimeType(file)!, false, HttpContext);
|
return FileStreamResponseHelpers.GetStaticFileResult(file, MimeTypes.GetMimeType(file), false, HttpContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -186,7 +186,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
});
|
});
|
||||||
|
|
||||||
return FileStreamResponseHelpers.GetStaticFileResult(path, MimeTypes.GetMimeType(path)!, false, HttpContext);
|
return FileStreamResponseHelpers.GetStaticFileResult(path, MimeTypes.GetMimeType(path), false, HttpContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
: null;
|
: null;
|
||||||
var dtoOptions = new DtoOptions { Fields = fields }
|
var dtoOptions = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(Request)
|
.AddClientFields(Request)
|
||||||
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes!);
|
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
|
||||||
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
|
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
|
||||||
return GetResult(items, user, limit, dtoOptions);
|
return GetResult(items, user, limit, dtoOptions);
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
: null;
|
: null;
|
||||||
var dtoOptions = new DtoOptions { Fields = fields }
|
var dtoOptions = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(Request)
|
.AddClientFields(Request)
|
||||||
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes!);
|
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
|
||||||
var items = _musicManager.GetInstantMixFromItem(album, user, dtoOptions);
|
var items = _musicManager.GetInstantMixFromItem(album, user, dtoOptions);
|
||||||
return GetResult(items, user, limit, dtoOptions);
|
return GetResult(items, user, limit, dtoOptions);
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
: null;
|
: null;
|
||||||
var dtoOptions = new DtoOptions { Fields = fields }
|
var dtoOptions = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(Request)
|
.AddClientFields(Request)
|
||||||
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes!);
|
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
|
||||||
var items = _musicManager.GetInstantMixFromItem(playlist, user, dtoOptions);
|
var items = _musicManager.GetInstantMixFromItem(playlist, user, dtoOptions);
|
||||||
return GetResult(items, user, limit, dtoOptions);
|
return GetResult(items, user, limit, dtoOptions);
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
: null;
|
: null;
|
||||||
var dtoOptions = new DtoOptions { Fields = fields }
|
var dtoOptions = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(Request)
|
.AddClientFields(Request)
|
||||||
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes!);
|
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
|
||||||
var items = _musicManager.GetInstantMixFromGenres(new[] { name }, user, dtoOptions);
|
var items = _musicManager.GetInstantMixFromGenres(new[] { name }, user, dtoOptions);
|
||||||
return GetResult(items, user, limit, dtoOptions);
|
return GetResult(items, user, limit, dtoOptions);
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
: null;
|
: null;
|
||||||
var dtoOptions = new DtoOptions { Fields = fields }
|
var dtoOptions = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(Request)
|
.AddClientFields(Request)
|
||||||
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes!);
|
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
|
||||||
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
|
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
|
||||||
return GetResult(items, user, limit, dtoOptions);
|
return GetResult(items, user, limit, dtoOptions);
|
||||||
}
|
}
|
||||||
|
@ -259,7 +259,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
: null;
|
: null;
|
||||||
var dtoOptions = new DtoOptions { Fields = fields }
|
var dtoOptions = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(Request)
|
.AddClientFields(Request)
|
||||||
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes!);
|
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
|
||||||
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
|
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
|
||||||
return GetResult(items, user, limit, dtoOptions);
|
return GetResult(items, user, limit, dtoOptions);
|
||||||
}
|
}
|
||||||
|
@ -332,7 +332,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
: null;
|
: null;
|
||||||
var dtoOptions = new DtoOptions { Fields = fields }
|
var dtoOptions = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(Request)
|
.AddClientFields(Request)
|
||||||
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes!);
|
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
|
||||||
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
|
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
|
||||||
return GetResult(items, user, limit, dtoOptions);
|
return GetResult(items, user, limit, dtoOptions);
|
||||||
}
|
}
|
||||||
|
|
|
@ -263,8 +263,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
item.DateCreated = NormalizeDateTime(request.DateCreated.Value);
|
item.DateCreated = NormalizeDateTime(request.DateCreated.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
item.EndDate = request.EndDate.HasValue ? NormalizeDateTime(request.EndDate.Value) : (DateTime?)null;
|
item.EndDate = request.EndDate.HasValue ? NormalizeDateTime(request.EndDate.Value) : null;
|
||||||
item.PremiereDate = request.PremiereDate.HasValue ? NormalizeDateTime(request.PremiereDate.Value) : (DateTime?)null;
|
item.PremiereDate = request.PremiereDate.HasValue ? NormalizeDateTime(request.PremiereDate.Value) : null;
|
||||||
item.ProductionYear = request.ProductionYear;
|
item.ProductionYear = request.ProductionYear;
|
||||||
item.OfficialRating = string.IsNullOrWhiteSpace(request.OfficialRating) ? null : request.OfficialRating;
|
item.OfficialRating = string.IsNullOrWhiteSpace(request.OfficialRating) ? null : request.OfficialRating;
|
||||||
item.CustomRating = request.CustomRating;
|
item.CustomRating = request.CustomRating;
|
||||||
|
|
|
@ -287,7 +287,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
if ((recursive.HasValue && recursive.Value) || ids.Length != 0 || item is not UserRootFolder)
|
if ((recursive.HasValue && recursive.Value) || ids.Length != 0 || item is not UserRootFolder)
|
||||||
{
|
{
|
||||||
var query = new InternalItemsQuery(user!)
|
var query = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IsPlayed = isPlayed,
|
IsPlayed = isPlayed,
|
||||||
MediaTypes = mediaTypes,
|
MediaTypes = mediaTypes,
|
||||||
|
|
|
@ -184,7 +184,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
audioStreamIndex,
|
audioStreamIndex,
|
||||||
subtitleStreamIndex,
|
subtitleStreamIndex,
|
||||||
maxAudioChannels,
|
maxAudioChannels,
|
||||||
info!.PlaySessionId!,
|
info.PlaySessionId!,
|
||||||
userId ?? Guid.Empty,
|
userId ?? Guid.Empty,
|
||||||
enableDirectPlay.Value,
|
enableDirectPlay.Value,
|
||||||
enableDirectStream.Value,
|
enableDirectStream.Value,
|
||||||
|
|
|
@ -88,7 +88,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
{
|
{
|
||||||
var options = new DtoOptions { Fields = fields }
|
var options = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(Request)
|
.AddClientFields(Request)
|
||||||
.AddAdditionalDtoOptions(enableImges, enableUserData, imageTypeLimit, enableImageTypes!);
|
.AddAdditionalDtoOptions(enableImges, enableUserData, imageTypeLimit, enableImageTypes);
|
||||||
|
|
||||||
var result = _tvSeriesManager.GetNextUp(
|
var result = _tvSeriesManager.GetNextUp(
|
||||||
new NextUpQuery
|
new NextUpQuery
|
||||||
|
@ -153,7 +153,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var options = new DtoOptions { Fields = fields }
|
var options = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(Request)
|
.AddClientFields(Request)
|
||||||
.AddAdditionalDtoOptions(enableImges, enableUserData, imageTypeLimit, enableImageTypes!);
|
.AddAdditionalDtoOptions(enableImges, enableUserData, imageTypeLimit, enableImageTypes);
|
||||||
|
|
||||||
var itemsResult = _libraryManager.GetItemList(new InternalItemsQuery(user)
|
var itemsResult = _libraryManager.GetItemList(new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
|
@ -223,7 +223,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var dtoOptions = new DtoOptions { Fields = fields }
|
var dtoOptions = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(Request)
|
.AddClientFields(Request)
|
||||||
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes!);
|
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
|
||||||
|
|
||||||
if (seasonId.HasValue) // Season id was supplied. Get episodes by season id.
|
if (seasonId.HasValue) // Season id was supplied. Get episodes by season id.
|
||||||
{
|
{
|
||||||
|
@ -350,7 +350,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var dtoOptions = new DtoOptions { Fields = fields }
|
var dtoOptions = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(Request)
|
.AddClientFields(Request)
|
||||||
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes!);
|
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
|
||||||
|
|
||||||
var returnItems = _dtoService.GetBaseItemDtos(seasons, dtoOptions, user);
|
var returnItems = _dtoService.GetBaseItemDtos(seasons, dtoOptions, user);
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
maxAudioChannels,
|
maxAudioChannels,
|
||||||
info!.PlaySessionId!,
|
info.PlaySessionId!,
|
||||||
userId ?? Guid.Empty,
|
userId ?? Guid.Empty,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
|
|
|
@ -461,7 +461,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var liveStream = new ProgressiveFileStream(liveStreamInfo.GetStream());
|
var liveStream = new ProgressiveFileStream(liveStreamInfo.GetStream());
|
||||||
// TODO (moved from MediaBrowser.Api): Don't hardcode contentType
|
// TODO (moved from MediaBrowser.Api): Don't hardcode contentType
|
||||||
return File(liveStream, MimeTypes.GetMimeType("file.ts")!);
|
return File(liveStream, MimeTypes.GetMimeType("file.ts"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static remote stream
|
// Static remote stream
|
||||||
|
|
|
@ -147,7 +147,7 @@ namespace Jellyfin.Api.Helpers
|
||||||
}
|
}
|
||||||
|
|
||||||
var outputPath = state.OutputFilePath;
|
var outputPath = state.OutputFilePath;
|
||||||
var outputPathExists = System.IO.File.Exists(outputPath);
|
var outputPathExists = File.Exists(outputPath);
|
||||||
|
|
||||||
var transcodingJob = _transcodingJobHelper.GetTranscodingJob(outputPath, TranscodingJobType.Progressive);
|
var transcodingJob = _transcodingJobHelper.GetTranscodingJob(outputPath, TranscodingJobType.Progressive);
|
||||||
var isTranscodeCached = outputPathExists && transcodingJob != null;
|
var isTranscodeCached = outputPathExists && transcodingJob != null;
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace Jellyfin.Api.Helpers
|
||||||
var value = GetClaimValue(user, InternalClaimTypes.UserId);
|
var value = GetClaimValue(user, InternalClaimTypes.UserId);
|
||||||
return string.IsNullOrEmpty(value)
|
return string.IsNullOrEmpty(value)
|
||||||
? null
|
? null
|
||||||
: (Guid?)Guid.Parse(value);
|
: Guid.Parse(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -86,8 +86,8 @@ namespace Jellyfin.Api.Helpers
|
||||||
|
|
||||||
DeleteEncodedMediaCache();
|
DeleteEncodedMediaCache();
|
||||||
|
|
||||||
sessionManager!.PlaybackProgress += OnPlaybackProgress;
|
sessionManager.PlaybackProgress += OnPlaybackProgress;
|
||||||
sessionManager!.PlaybackStart += OnPlaybackProgress;
|
sessionManager.PlaybackStart += OnPlaybackProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -878,8 +878,8 @@ namespace Jellyfin.Api.Helpers
|
||||||
if (disposing)
|
if (disposing)
|
||||||
{
|
{
|
||||||
_loggerFactory.Dispose();
|
_loggerFactory.Dispose();
|
||||||
_sessionManager!.PlaybackProgress -= OnPlaybackProgress;
|
_sessionManager.PlaybackProgress -= OnPlaybackProgress;
|
||||||
_sessionManager!.PlaybackStart -= OnPlaybackProgress;
|
_sessionManager.PlaybackStart -= OnPlaybackProgress;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ namespace Jellyfin.Api.Models.StreamingDtos
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the video request.
|
/// Gets the video request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public VideoRequestDto? VideoRequest => Request! as VideoRequestDto;
|
public VideoRequestDto? VideoRequest => Request as VideoRequestDto;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the direct stream provicer.
|
/// Gets or sets the direct stream provicer.
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace Jellyfin.Server.Implementations.Security
|
||||||
{
|
{
|
||||||
if (requestContext.Request.HttpContext.Items.TryGetValue("AuthorizationInfo", out var cached) && cached != null)
|
if (requestContext.Request.HttpContext.Items.TryGetValue("AuthorizationInfo", out var cached) && cached != null)
|
||||||
{
|
{
|
||||||
return Task.FromResult((AuthorizationInfo)cached!); // Cache should never contain null
|
return Task.FromResult((AuthorizationInfo)cached); // Cache should never contain null
|
||||||
}
|
}
|
||||||
|
|
||||||
return GetAuthorization(requestContext);
|
return GetAuthorization(requestContext);
|
||||||
|
|
|
@ -26,7 +26,6 @@ using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MediaBrowser.Model.IO;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Http.Extensions;
|
using Microsoft.AspNetCore.Http.Extensions;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
|
||||||
using Jellyfin.Extensions;
|
using Jellyfin.Extensions;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Http.Features;
|
using Microsoft.AspNetCore.Http.Features;
|
||||||
|
|
|
@ -120,7 +120,7 @@ namespace Jellyfin.Server.Migrations.Routines
|
||||||
|
|
||||||
var displayPreferences = new DisplayPreferences(dtoUserId, itemId, client)
|
var displayPreferences = new DisplayPreferences(dtoUserId, itemId, client)
|
||||||
{
|
{
|
||||||
IndexBy = Enum.TryParse<IndexingKind>(dto.IndexBy, true, out var indexBy) ? indexBy : (IndexingKind?)null,
|
IndexBy = Enum.TryParse<IndexingKind>(dto.IndexBy, true, out var indexBy) ? indexBy : null,
|
||||||
ShowBackdrop = dto.ShowBackdrop,
|
ShowBackdrop = dto.ShowBackdrop,
|
||||||
ShowSidebar = dto.ShowSidebar,
|
ShowSidebar = dto.ShowSidebar,
|
||||||
ScrollDirection = dto.ScrollDirection,
|
ScrollDirection = dto.ScrollDirection,
|
||||||
|
|
|
@ -594,7 +594,7 @@ namespace Jellyfin.Server
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Serilog.Log is used by SerilogLoggerFactory when no logger is specified
|
// Serilog.Log is used by SerilogLoggerFactory when no logger is specified
|
||||||
Serilog.Log.Logger = new LoggerConfiguration()
|
Log.Logger = new LoggerConfiguration()
|
||||||
.ReadFrom.Configuration(configuration)
|
.ReadFrom.Configuration(configuration)
|
||||||
.Enrich.FromLogContext()
|
.Enrich.FromLogContext()
|
||||||
.Enrich.WithThreadId()
|
.Enrich.WithThreadId()
|
||||||
|
@ -602,7 +602,7 @@ namespace Jellyfin.Server
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Serilog.Log.Logger = new LoggerConfiguration()
|
Log.Logger = new LoggerConfiguration()
|
||||||
.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss}] [{Level:u3}] [{ThreadId}] {SourceContext}: {Message:lj}{NewLine}{Exception}")
|
.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss}] [{Level:u3}] [{ThreadId}] {SourceContext}: {Message:lj}{NewLine}{Exception}")
|
||||||
.WriteTo.Async(x => x.File(
|
.WriteTo.Async(x => x.File(
|
||||||
Path.Combine(appPaths.LogDirectoryPath, "log_.log"),
|
Path.Combine(appPaths.LogDirectoryPath, "log_.log"),
|
||||||
|
@ -613,7 +613,7 @@ namespace Jellyfin.Server
|
||||||
.Enrich.WithThreadId()
|
.Enrich.WithThreadId()
|
||||||
.CreateLogger();
|
.CreateLogger();
|
||||||
|
|
||||||
Serilog.Log.Logger.Fatal(ex, "Failed to create/read logger configuration");
|
Log.Logger.Fatal(ex, "Failed to create/read logger configuration");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2997,7 +2997,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Equals(BaseItem other) => object.Equals(Id, other?.Id);
|
public bool Equals(BaseItem other) => Equals(Id, other?.Id);
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override int GetHashCode() => HashCode.Combine(Id);
|
public override int GetHashCode() => HashCode.Combine(Id);
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// <param name="file">The file.</param>
|
/// <param name="file">The file.</param>
|
||||||
public static void SetImagePath(this BaseItem item, ImageType imageType, string file)
|
public static void SetImagePath(this BaseItem item, ImageType imageType, string file)
|
||||||
{
|
{
|
||||||
if (file.StartsWith("http", System.StringComparison.OrdinalIgnoreCase))
|
if (file.StartsWith("http", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
item.SetImage(
|
item.SetImage(
|
||||||
new ItemImageInfo
|
new ItemImageInfo
|
||||||
|
|
|
@ -75,7 +75,7 @@ namespace MediaBrowser.MediaEncoding.BdInfo
|
||||||
x => new BdInfoFileInfo(x));
|
x => new BdInfoFileInfo(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IDirectoryInfo FromFileSystemPath(Model.IO.IFileSystem fs, string path)
|
public static IDirectoryInfo FromFileSystemPath(IFileSystem fs, string path)
|
||||||
{
|
{
|
||||||
return new BdInfoDirectoryInfo(fs, path);
|
return new BdInfoDirectoryInfo(fs, path);
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,6 @@ namespace MediaBrowser.Model.Dlna
|
||||||
if (string.IsNullOrEmpty(orgPn))
|
if (string.IsNullOrEmpty(orgPn))
|
||||||
{
|
{
|
||||||
contentFeatureList.Add(orgOp.TrimStart(';') + orgCi + dlnaflags);
|
contentFeatureList.Add(orgOp.TrimStart(';') + orgCi + dlnaflags);
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1229,7 +1229,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
|
|
||||||
bool result = IsAudioEligibleForDirectPlay(item, maxBitrate, playMethod);
|
bool result = IsAudioEligibleForDirectPlay(item, maxBitrate, playMethod);
|
||||||
|
|
||||||
return (result, result ? (TranscodeReason?)null : TranscodeReason.ContainerBitrateExceedsLimit);
|
return (result, result ? null : TranscodeReason.ContainerBitrateExceedsLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SubtitleProfile GetSubtitleProfile(
|
public static SubtitleProfile GetSubtitleProfile(
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.Globalization
|
namespace MediaBrowser.Model.Globalization
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
using System;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.IO
|
namespace MediaBrowser.Model.IO
|
||||||
|
|
|
@ -13,7 +13,6 @@ using MediaBrowser.Controller.Entities.Movies;
|
||||||
using MediaBrowser.Controller.Providers;
|
using MediaBrowser.Controller.Providers;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.Extensions;
|
|
||||||
using MediaBrowser.Model.Providers;
|
using MediaBrowser.Model.Providers;
|
||||||
|
|
||||||
namespace MediaBrowser.Providers.Plugins.Tmdb.BoxSets
|
namespace MediaBrowser.Providers.Plugins.Tmdb.BoxSets
|
||||||
|
|
|
@ -13,7 +13,6 @@ using MediaBrowser.Controller.Entities.TV;
|
||||||
using MediaBrowser.Controller.Providers;
|
using MediaBrowser.Controller.Providers;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.Extensions;
|
|
||||||
using MediaBrowser.Model.Providers;
|
using MediaBrowser.Model.Providers;
|
||||||
|
|
||||||
namespace MediaBrowser.Providers.Plugins.Tmdb.TV
|
namespace MediaBrowser.Providers.Plugins.Tmdb.TV
|
||||||
|
|
|
@ -395,7 +395,7 @@ namespace Rssdp.Infrastructure
|
||||||
// Strange cannot convert compiler error here if I don't explicitly
|
// Strange cannot convert compiler error here if I don't explicitly
|
||||||
// assign or cast to Action first. Assignment is easier to read,
|
// assign or cast to Action first. Assignment is easier to read,
|
||||||
// so went with that.
|
// so went with that.
|
||||||
ProcessMessage(System.Text.UTF8Encoding.UTF8.GetString(result.Buffer, 0, result.ReceivedBytes), result.RemoteEndPoint, result.LocalIPAddress);
|
ProcessMessage(UTF8Encoding.UTF8.GetString(result.Buffer, 0, result.ReceivedBytes), result.RemoteEndPoint, result.LocalIPAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (ObjectDisposedException)
|
catch (ObjectDisposedException)
|
||||||
|
|
|
@ -513,7 +513,7 @@ namespace Rssdp.Infrastructure
|
||||||
return TimeSpan.Zero;
|
return TimeSpan.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (TimeSpan)(headerValue.MaxAge ?? headerValue.SharedMaxAge ?? TimeSpan.Zero);
|
return headerValue.MaxAge ?? headerValue.SharedMaxAge ?? TimeSpan.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RemoveExpiredDevicesFromCache()
|
private void RemoveExpiredDevicesFromCache()
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using Jellyfin.Api.Controllers;
|
using Jellyfin.Api.Controllers;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using MediaBrowser.MediaEncoding.Encoder;
|
using MediaBrowser.MediaEncoding.Encoder;
|
||||||
using Microsoft.Extensions.Logging.Abstractions;
|
using Microsoft.Extensions.Logging.Abstractions;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
|
@ -1,23 +1,11 @@
|
||||||
using System;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.IO;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AutoFixture;
|
using AutoFixture;
|
||||||
using AutoFixture.AutoMoq;
|
using AutoFixture.AutoMoq;
|
||||||
using MediaBrowser.Common.Configuration;
|
|
||||||
using MediaBrowser.Common.Extensions;
|
|
||||||
using MediaBrowser.Common.Net;
|
|
||||||
using MediaBrowser.Controller.Entities;
|
|
||||||
using MediaBrowser.Controller.Library;
|
|
||||||
using MediaBrowser.Controller.MediaEncoding;
|
|
||||||
using MediaBrowser.MediaEncoding.Subtitles;
|
using MediaBrowser.MediaEncoding.Subtitles;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.IO;
|
|
||||||
using MediaBrowser.Model.MediaInfo;
|
using MediaBrowser.Model.MediaInfo;
|
||||||
using Microsoft.Extensions.Logging.Abstractions;
|
|
||||||
using Moq;
|
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace Jellyfin.MediaEncoding.Subtitles.Tests
|
namespace Jellyfin.MediaEncoding.Subtitles.Tests
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using Emby.Naming.AudioBook;
|
using Emby.Naming.AudioBook;
|
||||||
using Emby.Naming.Common;
|
using Emby.Naming.Common;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Emby.Naming.Common;
|
using Emby.Naming.Common;
|
||||||
using Emby.Naming.Video;
|
using Emby.Naming.Video;
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace Jellyfin.Networking.Tests
|
||||||
CallBase = true
|
CallBase = true
|
||||||
};
|
};
|
||||||
configManager.Setup(x => x.GetConfiguration(It.IsAny<string>())).Returns(conf);
|
configManager.Setup(x => x.GetConfiguration(It.IsAny<string>())).Returns(conf);
|
||||||
return (IConfigurationManager)configManager.Object;
|
return configManager.Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using Emby.Server.Implementations.LiveTv.EmbyTV;
|
using Emby.Server.Implementations.LiveTv.EmbyTV;
|
||||||
using MediaBrowser.Controller.LiveTv;
|
using MediaBrowser.Controller.LiveTv;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Emby.Server.Implementations.Sorting;
|
using Emby.Server.Implementations.Sorting;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Entities.Movies;
|
using MediaBrowser.Controller.Entities.Movies;
|
||||||
|
|
Loading…
Reference in a new issue