mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-31 12:14:21 -04:00
Enable TreatWarningsAsErrors for Jellyfin.Server.Implementations in Release mode
This commit is contained in:
parent
02624c9df8
commit
4748105dce
@ -46,14 +46,14 @@ namespace Emby.Server.Implementations.Channels
|
|||||||
new ConcurrentDictionary<string, Tuple<DateTime, List<MediaSourceInfo>>>();
|
new ConcurrentDictionary<string, Tuple<DateTime, List<MediaSourceInfo>>>();
|
||||||
|
|
||||||
private readonly SemaphoreSlim _resourcePool = new SemaphoreSlim(1, 1);
|
private readonly SemaphoreSlim _resourcePool = new SemaphoreSlim(1, 1);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ChannelManager"/> class.
|
/// Initializes a new instance of the <see cref="ChannelManager"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userManager">The user manager.</param>
|
/// <param name="userManager">The user manager.</param>
|
||||||
/// <param name="dtoService">The dto service.</param>
|
/// <param name="dtoService">The dto service.</param>
|
||||||
/// <param name="libraryManager">The library manager.</param>
|
/// <param name="libraryManager">The library manager.</param>
|
||||||
/// <param name="loggerFactory">The logger factory.</param>
|
/// <param name="logger">The logger.</param>
|
||||||
/// <param name="config">The server configuration manager.</param>
|
/// <param name="config">The server configuration manager.</param>
|
||||||
/// <param name="fileSystem">The filesystem.</param>
|
/// <param name="fileSystem">The filesystem.</param>
|
||||||
/// <param name="userDataManager">The user data manager.</param>
|
/// <param name="userDataManager">The user data manager.</param>
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
@ -33,7 +35,7 @@ using SQLitePCL.pretty;
|
|||||||
namespace Emby.Server.Implementations.Data
|
namespace Emby.Server.Implementations.Data
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class SQLiteItemRepository
|
/// Class SQLiteItemRepository.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SqliteItemRepository : BaseSqliteRepository, IItemRepository
|
public class SqliteItemRepository : BaseSqliteRepository, IItemRepository
|
||||||
{
|
{
|
||||||
@ -1971,6 +1973,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
/// Gets the chapter.
|
/// Gets the chapter.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reader">The reader.</param>
|
/// <param name="reader">The reader.</param>
|
||||||
|
/// <param name="item">The item.</param>
|
||||||
/// <returns>ChapterInfo.</returns>
|
/// <returns>ChapterInfo.</returns>
|
||||||
private ChapterInfo GetChapter(IReadOnlyList<IResultSetValue> reader, BaseItem item)
|
private ChapterInfo GetChapter(IReadOnlyList<IResultSetValue> reader, BaseItem item)
|
||||||
{
|
{
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>netstandard2.1</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
<TreatWarningsAsErrors Condition=" '$(Configuration)' == 'Release'" >true</TreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Code Analyzers-->
|
<!-- Code Analyzers-->
|
||||||
|
@ -47,10 +47,11 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public async Task RunAsync()
|
public Task RunAsync()
|
||||||
{
|
{
|
||||||
_udpServer = new UdpServer(_logger, _appHost, _config);
|
_udpServer = new UdpServer(_logger, _appHost, _config);
|
||||||
_udpServer.Start(PortNumber, _cancellationTokenSource.Token);
|
_udpServer.Start(PortNumber, _cancellationTokenSource.Token);
|
||||||
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
@ -56,6 +56,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the result.
|
/// Gets the result.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="requestContext">The request context.</param>
|
||||||
/// <param name="content">The content.</param>
|
/// <param name="content">The content.</param>
|
||||||
/// <param name="contentType">Type of the content.</param>
|
/// <param name="contentType">Type of the content.</param>
|
||||||
/// <param name="responseHeaders">The response headers.</param>
|
/// <param name="responseHeaders">The response headers.</param>
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations
|
namespace Emby.Server.Implementations
|
||||||
|
@ -135,43 +135,5 @@ namespace Emby.Server.Implementations.Library
|
|||||||
? null
|
? null
|
||||||
: Hex.Encode(PasswordHash.Parse(user.EasyPassword).Hash);
|
: Hex.Encode(PasswordHash.Parse(user.EasyPassword).Hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the hashed string.
|
|
||||||
/// </summary>
|
|
||||||
public string GetHashedString(User user, string str)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(user.Password))
|
|
||||||
{
|
|
||||||
return _cryptographyProvider.CreatePasswordHash(str).ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: make use of iterations parameter?
|
|
||||||
PasswordHash passwordHash = PasswordHash.Parse(user.Password);
|
|
||||||
var salt = passwordHash.Salt.ToArray();
|
|
||||||
return new PasswordHash(
|
|
||||||
passwordHash.Id,
|
|
||||||
_cryptographyProvider.ComputeHash(
|
|
||||||
passwordHash.Id,
|
|
||||||
Encoding.UTF8.GetBytes(str),
|
|
||||||
salt),
|
|
||||||
salt,
|
|
||||||
passwordHash.Parameters.ToDictionary(x => x.Key, y => y.Value)).ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReadOnlySpan<byte> GetHashed(User user, string str)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(user.Password))
|
|
||||||
{
|
|
||||||
return _cryptographyProvider.CreatePasswordHash(str).Hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: make use of iterations parameter?
|
|
||||||
PasswordHash passwordHash = PasswordHash.Parse(user.Password);
|
|
||||||
return _cryptographyProvider.ComputeHash(
|
|
||||||
passwordHash.Id,
|
|
||||||
Encoding.UTF8.GetBytes(str),
|
|
||||||
passwordHash.Salt.ToArray());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ using VideoResolver = Emby.Naming.Video.VideoResolver;
|
|||||||
namespace Emby.Server.Implementations.Library
|
namespace Emby.Server.Implementations.Library
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class LibraryManager
|
/// Class LibraryManager.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LibraryManager : ILibraryManager
|
public class LibraryManager : ILibraryManager
|
||||||
{
|
{
|
||||||
@ -135,6 +135,12 @@ namespace Emby.Server.Implementations.Library
|
|||||||
/// <param name="userManager">The user manager.</param>
|
/// <param name="userManager">The user manager.</param>
|
||||||
/// <param name="configurationManager">The configuration manager.</param>
|
/// <param name="configurationManager">The configuration manager.</param>
|
||||||
/// <param name="userDataRepository">The user data repository.</param>
|
/// <param name="userDataRepository">The user data repository.</param>
|
||||||
|
/// <param name="libraryMonitorFactory">The library monitor.</param>
|
||||||
|
/// <param name="fileSystem">The file system.</param>
|
||||||
|
/// <param name="providerManagerFactory">The provider manager.</param>
|
||||||
|
/// <param name="userviewManagerFactory">The userview manager.</param>
|
||||||
|
/// <param name="mediaEncoder">The media encoder.</param>
|
||||||
|
/// <param name="itemRepository">The item repository.</param>
|
||||||
public LibraryManager(
|
public LibraryManager(
|
||||||
IServerApplicationHost appHost,
|
IServerApplicationHost appHost,
|
||||||
ILogger<LibraryManager> logger,
|
ILogger<LibraryManager> logger,
|
||||||
|
@ -10,10 +10,8 @@ using Emby.Server.Implementations.Library;
|
|||||||
using MediaBrowser.Common.Configuration;
|
using MediaBrowser.Common.Configuration;
|
||||||
using MediaBrowser.Common.Extensions;
|
using MediaBrowser.Common.Extensions;
|
||||||
using MediaBrowser.Common.Progress;
|
using MediaBrowser.Common.Progress;
|
||||||
using MediaBrowser.Controller;
|
|
||||||
using MediaBrowser.Controller.Channels;
|
using MediaBrowser.Controller.Channels;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
using MediaBrowser.Controller.Drawing;
|
|
||||||
using MediaBrowser.Controller.Dto;
|
using MediaBrowser.Controller.Dto;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Entities.Movies;
|
using MediaBrowser.Controller.Entities.Movies;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Emby.Server.Implementations.Images;
|
using Emby.Server.Implementations.Images;
|
||||||
@ -32,9 +34,7 @@ namespace Emby.Server.Implementations.Playlists
|
|||||||
{
|
{
|
||||||
var subItem = i.Item2;
|
var subItem = i.Item2;
|
||||||
|
|
||||||
var episode = subItem as Episode;
|
if (subItem is Episode episode)
|
||||||
|
|
||||||
if (episode != null)
|
|
||||||
{
|
{
|
||||||
var series = episode.Series;
|
var series = episode.Series;
|
||||||
if (series != null && series.HasImage(ImageType.Primary))
|
if (series != null && series.HasImage(ImageType.Primary))
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using MediaBrowser.Controller;
|
using MediaBrowser.Controller;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@ -51,7 +53,6 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The task manager.</value>
|
/// <value>The task manager.</value>
|
||||||
private ITaskManager TaskManager { get; set; }
|
private ITaskManager TaskManager { get; set; }
|
||||||
private readonly IFileSystem _fileSystem;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ScheduledTaskWorker" /> class.
|
/// Initializes a new instance of the <see cref="ScheduledTaskWorker" /> class.
|
||||||
@ -72,24 +73,28 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
/// or
|
/// or
|
||||||
/// logger
|
/// logger
|
||||||
/// </exception>
|
/// </exception>
|
||||||
public ScheduledTaskWorker(IScheduledTask scheduledTask, IApplicationPaths applicationPaths, ITaskManager taskManager, IJsonSerializer jsonSerializer, ILogger logger, IFileSystem fileSystem)
|
public ScheduledTaskWorker(IScheduledTask scheduledTask, IApplicationPaths applicationPaths, ITaskManager taskManager, IJsonSerializer jsonSerializer, ILogger logger)
|
||||||
{
|
{
|
||||||
if (scheduledTask == null)
|
if (scheduledTask == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(scheduledTask));
|
throw new ArgumentNullException(nameof(scheduledTask));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (applicationPaths == null)
|
if (applicationPaths == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(applicationPaths));
|
throw new ArgumentNullException(nameof(applicationPaths));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taskManager == null)
|
if (taskManager == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(taskManager));
|
throw new ArgumentNullException(nameof(taskManager));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jsonSerializer == null)
|
if (jsonSerializer == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(jsonSerializer));
|
throw new ArgumentNullException(nameof(jsonSerializer));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logger == null)
|
if (logger == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(logger));
|
throw new ArgumentNullException(nameof(logger));
|
||||||
@ -100,7 +105,6 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
TaskManager = taskManager;
|
TaskManager = taskManager;
|
||||||
JsonSerializer = jsonSerializer;
|
JsonSerializer = jsonSerializer;
|
||||||
Logger = logger;
|
Logger = logger;
|
||||||
_fileSystem = fileSystem;
|
|
||||||
|
|
||||||
InitTriggerEvents();
|
InitTriggerEvents();
|
||||||
}
|
}
|
||||||
@ -576,6 +580,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
/// <param name="startTime">The start time.</param>
|
/// <param name="startTime">The start time.</param>
|
||||||
/// <param name="endTime">The end time.</param>
|
/// <param name="endTime">The end time.</param>
|
||||||
/// <param name="status">The status.</param>
|
/// <param name="status">The status.</param>
|
||||||
|
/// <param name="ex">The exception.</param>
|
||||||
private void OnTaskCompleted(DateTime startTime, DateTime endTime, TaskCompletionStatus status, Exception ex)
|
private void OnTaskCompleted(DateTime startTime, DateTime endTime, TaskCompletionStatus status, Exception ex)
|
||||||
{
|
{
|
||||||
var elapsedTime = endTime - startTime;
|
var elapsedTime = endTime - startTime;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -199,7 +201,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
/// <param name="tasks">The tasks.</param>
|
/// <param name="tasks">The tasks.</param>
|
||||||
public void AddTasks(IEnumerable<IScheduledTask> tasks)
|
public void AddTasks(IEnumerable<IScheduledTask> tasks)
|
||||||
{
|
{
|
||||||
var list = tasks.Select(t => new ScheduledTaskWorker(t, _applicationPaths, this, _jsonSerializer, _logger, _fileSystem));
|
var list = tasks.Select(t => new ScheduledTaskWorker(t, _applicationPaths, this, _jsonSerializer, _logger));
|
||||||
|
|
||||||
ScheduledTasks = ScheduledTasks.Concat(list).ToArray();
|
ScheduledTasks = ScheduledTasks.Concat(list).ToArray();
|
||||||
}
|
}
|
||||||
|
@ -169,18 +169,25 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Name => _localization.GetLocalizedString("TaskRefreshChapterImages");
|
public string Name => _localization.GetLocalizedString("TaskRefreshChapterImages");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Description => _localization.GetLocalizedString("TaskRefreshChapterImagesDescription");
|
public string Description => _localization.GetLocalizedString("TaskRefreshChapterImagesDescription");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Category => _localization.GetLocalizedString("TasksLibraryCategory");
|
public string Category => _localization.GetLocalizedString("TasksLibraryCategory");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Key => "RefreshChapterImages";
|
public string Key => "RefreshChapterImages";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsHidden => false;
|
public bool IsHidden => false;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsEnabled => true;
|
public bool IsEnabled => true;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsLogged => true;
|
public bool IsLogged => true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -165,18 +165,25 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Name => _localization.GetLocalizedString("TaskCleanCache");
|
public string Name => _localization.GetLocalizedString("TaskCleanCache");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Description => _localization.GetLocalizedString("TaskCleanCacheDescription");
|
public string Description => _localization.GetLocalizedString("TaskCleanCacheDescription");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Category => _localization.GetLocalizedString("TasksMaintenanceCategory");
|
public string Category => _localization.GetLocalizedString("TasksMaintenanceCategory");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Key => "DeleteCacheFiles";
|
public string Key => "DeleteCacheFiles";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsHidden => false;
|
public bool IsHidden => false;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsEnabled => true;
|
public bool IsEnabled => true;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsLogged => true;
|
public bool IsLogged => true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,8 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
/// Initializes a new instance of the <see cref="DeleteLogFileTask" /> class.
|
/// Initializes a new instance of the <see cref="DeleteLogFileTask" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="configurationManager">The configuration manager.</param>
|
/// <param name="configurationManager">The configuration manager.</param>
|
||||||
|
/// <param name="fileSystem">The file system.</param>
|
||||||
|
/// <param name="localization">The localization manager.</param>
|
||||||
public DeleteLogFileTask(IConfigurationManager configurationManager, IFileSystem fileSystem, ILocalizationManager localization)
|
public DeleteLogFileTask(IConfigurationManager configurationManager, IFileSystem fileSystem, ILocalizationManager localization)
|
||||||
{
|
{
|
||||||
ConfigurationManager = configurationManager;
|
ConfigurationManager = configurationManager;
|
||||||
@ -82,18 +84,25 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Name => _localization.GetLocalizedString("TaskCleanLogs");
|
public string Name => _localization.GetLocalizedString("TaskCleanLogs");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Description => string.Format(_localization.GetLocalizedString("TaskCleanLogsDescription"), ConfigurationManager.CommonConfiguration.LogFileRetentionDays);
|
public string Description => string.Format(_localization.GetLocalizedString("TaskCleanLogsDescription"), ConfigurationManager.CommonConfiguration.LogFileRetentionDays);
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Category => _localization.GetLocalizedString("TasksMaintenanceCategory");
|
public string Category => _localization.GetLocalizedString("TasksMaintenanceCategory");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Key => "CleanLogFiles";
|
public string Key => "CleanLogFiles";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsHidden => false;
|
public bool IsHidden => false;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsEnabled => true;
|
public bool IsEnabled => true;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsLogged => true;
|
public bool IsLogged => true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,18 +132,25 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Name => _localization.GetLocalizedString("TaskCleanTranscode");
|
public string Name => _localization.GetLocalizedString("TaskCleanTranscode");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Description => _localization.GetLocalizedString("TaskCleanTranscodeDescription");
|
public string Description => _localization.GetLocalizedString("TaskCleanTranscodeDescription");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Category => _localization.GetLocalizedString("TasksMaintenanceCategory");
|
public string Category => _localization.GetLocalizedString("TasksMaintenanceCategory");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Key => "DeleteTranscodeFiles";
|
public string Key => "DeleteTranscodeFiles";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsHidden => false;
|
public bool IsHidden => false;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsEnabled => false;
|
public bool IsEnabled => false;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsLogged => true;
|
public bool IsLogged => true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MediaBrowser.Controller;
|
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
using MediaBrowser.Model.Globalization;
|
using MediaBrowser.Model.Globalization;
|
||||||
@ -18,19 +19,16 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
/// The library manager.
|
/// The library manager.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly ILibraryManager _libraryManager;
|
private readonly ILibraryManager _libraryManager;
|
||||||
|
|
||||||
private readonly IServerApplicationHost _appHost;
|
|
||||||
private readonly ILocalizationManager _localization;
|
private readonly ILocalizationManager _localization;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PeopleValidationTask" /> class.
|
/// Initializes a new instance of the <see cref="PeopleValidationTask" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="libraryManager">The library manager.</param>
|
/// <param name="libraryManager">The library manager.</param>
|
||||||
/// <param name="appHost">The server application host</param>
|
/// <param name="localization">The localization manager.</param>
|
||||||
public PeopleValidationTask(ILibraryManager libraryManager, IServerApplicationHost appHost, ILocalizationManager localization)
|
public PeopleValidationTask(ILibraryManager libraryManager, ILocalizationManager localization)
|
||||||
{
|
{
|
||||||
_libraryManager = libraryManager;
|
_libraryManager = libraryManager;
|
||||||
_appHost = appHost;
|
|
||||||
_localization = localization;
|
_localization = localization;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Emby.Server.Implementations.Library;
|
using Emby.Server.Implementations.Library;
|
||||||
using MediaBrowser.Controller.Configuration;
|
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
using MediaBrowser.Model.Globalization;
|
using MediaBrowser.Model.Globalization;
|
||||||
@ -16,20 +17,19 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
public class RefreshMediaLibraryTask : IScheduledTask
|
public class RefreshMediaLibraryTask : IScheduledTask
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The _library manager
|
/// The _library manager.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly ILibraryManager _libraryManager;
|
private readonly ILibraryManager _libraryManager;
|
||||||
private readonly IServerConfigurationManager _config;
|
|
||||||
private readonly ILocalizationManager _localization;
|
private readonly ILocalizationManager _localization;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="RefreshMediaLibraryTask" /> class.
|
/// Initializes a new instance of the <see cref="RefreshMediaLibraryTask" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="libraryManager">The library manager.</param>
|
/// <param name="libraryManager">The library manager.</param>
|
||||||
public RefreshMediaLibraryTask(ILibraryManager libraryManager, IServerConfigurationManager config, ILocalizationManager localization)
|
/// <param name="localization">The localization manager.</param>
|
||||||
|
public RefreshMediaLibraryTask(ILibraryManager libraryManager, ILocalizationManager localization)
|
||||||
{
|
{
|
||||||
_libraryManager = libraryManager;
|
_libraryManager = libraryManager;
|
||||||
_config = config;
|
|
||||||
_localization = localization;
|
_localization = localization;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,18 +61,25 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
return ((LibraryManager)_libraryManager).ValidateMediaLibraryInternal(progress, cancellationToken);
|
return ((LibraryManager)_libraryManager).ValidateMediaLibraryInternal(progress, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Name => _localization.GetLocalizedString("TaskRefreshLibrary");
|
public string Name => _localization.GetLocalizedString("TaskRefreshLibrary");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Description => _localization.GetLocalizedString("TaskRefreshLibraryDescription");
|
public string Description => _localization.GetLocalizedString("TaskRefreshLibraryDescription");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Category => _localization.GetLocalizedString("TasksLibraryCategory");
|
public string Category => _localization.GetLocalizedString("TasksLibraryCategory");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string Key => "RefreshLibrary";
|
public string Key => "RefreshLibrary";
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsHidden => false;
|
public bool IsHidden => false;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsEnabled => true;
|
public bool IsEnabled => true;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsLogged => true;
|
public bool IsLogged => true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,8 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
/// Stars waiting for the trigger action
|
/// Stars waiting for the trigger action
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="lastResult">The last result.</param>
|
/// <param name="lastResult">The last result.</param>
|
||||||
|
/// <param name="logger">The logger.</param>
|
||||||
|
/// <param name="taskName">The name of the task.</param>
|
||||||
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
||||||
public void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
|
public void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
|
||||||
{
|
{
|
||||||
@ -77,10 +79,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void OnTriggered()
|
private void OnTriggered()
|
||||||
{
|
{
|
||||||
if (Triggered != null)
|
Triggered?.Invoke(this, EventArgs.Empty);
|
||||||
{
|
|
||||||
Triggered(this, EventArgs.Empty);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,8 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
/// Stars waiting for the trigger action
|
/// Stars waiting for the trigger action
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="lastResult">The last result.</param>
|
/// <param name="lastResult">The last result.</param>
|
||||||
|
/// <param name="logger">The logger.</param>
|
||||||
|
/// <param name="taskName">The name of the task.</param>
|
||||||
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
||||||
public void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
|
public void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
|
||||||
{
|
{
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
@ -6,7 +8,7 @@ using Microsoft.Extensions.Logging;
|
|||||||
namespace Emby.Server.Implementations.ScheduledTasks
|
namespace Emby.Server.Implementations.ScheduledTasks
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class StartupTaskTrigger
|
/// Class StartupTaskTrigger.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class StartupTrigger : ITaskTrigger
|
public class StartupTrigger : ITaskTrigger
|
||||||
{
|
{
|
||||||
@ -26,6 +28,8 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
/// Stars waiting for the trigger action
|
/// Stars waiting for the trigger action
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="lastResult">The last result.</param>
|
/// <param name="lastResult">The last result.</param>
|
||||||
|
/// <param name="logger">The logger.</param>
|
||||||
|
/// <param name="taskName">The name of the task.</param>
|
||||||
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
||||||
public async void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
|
public async void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
|
||||||
{
|
{
|
||||||
|
@ -37,6 +37,8 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
/// Stars waiting for the trigger action
|
/// Stars waiting for the trigger action
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="lastResult">The last result.</param>
|
/// <param name="lastResult">The last result.</param>
|
||||||
|
/// <param name="logger">The logger.</param>
|
||||||
|
/// <param name="taskName">The name of the task.</param>
|
||||||
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
||||||
public void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
|
public void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
|
||||||
{
|
{
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@ -11,6 +13,9 @@ namespace Emby.Server.Implementations.Serialization
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class JsonSerializer : IJsonSerializer
|
public class JsonSerializer : IJsonSerializer
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="JsonSerializer" /> class.
|
||||||
|
/// </summary>
|
||||||
public JsonSerializer()
|
public JsonSerializer()
|
||||||
{
|
{
|
||||||
ServiceStack.Text.JsConfig.DateHandler = ServiceStack.Text.DateHandler.ISO8601;
|
ServiceStack.Text.JsConfig.DateHandler = ServiceStack.Text.DateHandler.ISO8601;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -43,10 +45,7 @@ namespace Emby.Server.Implementations.Services
|
|||||||
|
|
||||||
private static string GetContentTypeWithoutEncoding(string contentType)
|
private static string GetContentTypeWithoutEncoding(string contentType)
|
||||||
{
|
{
|
||||||
return contentType == null
|
return contentType?.Split(';')[0].ToLowerInvariant().Trim();
|
||||||
? null
|
|
||||||
: contentType.Split(';')[0].ToLowerInvariant().Trim();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@ -43,8 +45,7 @@ namespace Emby.Server.Implementations.Services
|
|||||||
response.StatusCode = httpResult.Status;
|
response.StatusCode = httpResult.Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
var responseOptions = result as IHasHeaders;
|
if (result is IHasHeaders responseOptions)
|
||||||
if (responseOptions != null)
|
|
||||||
{
|
{
|
||||||
foreach (var responseHeaders in responseOptions.Headers)
|
foreach (var responseHeaders in responseOptions.Headers)
|
||||||
{
|
{
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.Services
|
namespace Emby.Server.Implementations.Services
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using MediaBrowser.Common.Extensions;
|
using MediaBrowser.Common.Extensions;
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
using System.IO;
|
|
||||||
using MediaBrowser.Model.Services;
|
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.SocketSharp
|
|
||||||
{
|
|
||||||
public class HttpFile : IHttpFile
|
|
||||||
{
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
public string FileName { get; set; }
|
|
||||||
|
|
||||||
public long ContentLength { get; set; }
|
|
||||||
|
|
||||||
public string ContentType { get; set; }
|
|
||||||
|
|
||||||
public Stream InputStream { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,198 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
public sealed class HttpPostedFile : IDisposable
|
|
||||||
{
|
|
||||||
private string _name;
|
|
||||||
private string _contentType;
|
|
||||||
private Stream _stream;
|
|
||||||
private bool _disposed = false;
|
|
||||||
|
|
||||||
internal HttpPostedFile(string name, string content_type, Stream base_stream, long offset, long length)
|
|
||||||
{
|
|
||||||
_name = name;
|
|
||||||
_contentType = content_type;
|
|
||||||
_stream = new ReadSubStream(base_stream, offset, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ContentType => _contentType;
|
|
||||||
|
|
||||||
public int ContentLength => (int)_stream.Length;
|
|
||||||
|
|
||||||
public string FileName => _name;
|
|
||||||
|
|
||||||
public Stream InputStream => _stream;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Releases the unmanaged resources and disposes of the managed resources used.
|
|
||||||
/// </summary>
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
if (_disposed)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_stream.Dispose();
|
|
||||||
_stream = null;
|
|
||||||
|
|
||||||
_name = null;
|
|
||||||
_contentType = null;
|
|
||||||
|
|
||||||
_disposed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ReadSubStream : Stream
|
|
||||||
{
|
|
||||||
private Stream _stream;
|
|
||||||
private long _offset;
|
|
||||||
private long _end;
|
|
||||||
private long _position;
|
|
||||||
|
|
||||||
public ReadSubStream(Stream s, long offset, long length)
|
|
||||||
{
|
|
||||||
_stream = s;
|
|
||||||
_offset = offset;
|
|
||||||
_end = offset + length;
|
|
||||||
_position = offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CanRead => true;
|
|
||||||
|
|
||||||
public override bool CanSeek => true;
|
|
||||||
|
|
||||||
public override bool CanWrite => false;
|
|
||||||
|
|
||||||
public override long Length => _end - _offset;
|
|
||||||
|
|
||||||
public override long Position
|
|
||||||
{
|
|
||||||
get => _position - _offset;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value > Length)
|
|
||||||
{
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
_position = Seek(value, SeekOrigin.Begin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Flush()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int Read(byte[] buffer, int dest_offset, int count)
|
|
||||||
{
|
|
||||||
if (buffer == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException(nameof(buffer));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dest_offset < 0)
|
|
||||||
{
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(dest_offset), "< 0");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count < 0)
|
|
||||||
{
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(count), "< 0");
|
|
||||||
}
|
|
||||||
|
|
||||||
int len = buffer.Length;
|
|
||||||
if (dest_offset > len)
|
|
||||||
{
|
|
||||||
throw new ArgumentException("destination offset is beyond array size", nameof(dest_offset));
|
|
||||||
}
|
|
||||||
|
|
||||||
// reordered to avoid possible integer overflow
|
|
||||||
if (dest_offset > len - count)
|
|
||||||
{
|
|
||||||
throw new ArgumentException("Reading would overrun buffer", nameof(count));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count > _end - _position)
|
|
||||||
{
|
|
||||||
count = (int)(_end - _position);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count <= 0)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
_stream.Position = _position;
|
|
||||||
int result = _stream.Read(buffer, dest_offset, count);
|
|
||||||
if (result > 0)
|
|
||||||
{
|
|
||||||
_position += result;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_position = _end;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int ReadByte()
|
|
||||||
{
|
|
||||||
if (_position >= _end)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
_stream.Position = _position;
|
|
||||||
int result = _stream.ReadByte();
|
|
||||||
if (result < 0)
|
|
||||||
{
|
|
||||||
_position = _end;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_position++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override long Seek(long d, SeekOrigin origin)
|
|
||||||
{
|
|
||||||
long real;
|
|
||||||
switch (origin)
|
|
||||||
{
|
|
||||||
case SeekOrigin.Begin:
|
|
||||||
real = _offset + d;
|
|
||||||
break;
|
|
||||||
case SeekOrigin.End:
|
|
||||||
real = _end + d;
|
|
||||||
break;
|
|
||||||
case SeekOrigin.Current:
|
|
||||||
real = _position + d;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new ArgumentException("Unknown SeekOrigin value", nameof(origin));
|
|
||||||
}
|
|
||||||
|
|
||||||
long virt = real - _offset;
|
|
||||||
if (virt < 0 || virt > Length)
|
|
||||||
{
|
|
||||||
throw new ArgumentException("Invalid position", nameof(d));
|
|
||||||
}
|
|
||||||
|
|
||||||
_position = _stream.Seek(real, SeekOrigin.Begin);
|
|
||||||
return _position;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void SetLength(long value)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Write(byte[] buffer, int offset, int count)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Entities.TV;
|
using MediaBrowser.Controller.Entities.TV;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Sorting;
|
using MediaBrowser.Controller.Sorting;
|
||||||
@ -7,6 +9,12 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
{
|
{
|
||||||
public class CommunityRatingComparer : IBaseItemComparer
|
public class CommunityRatingComparer : IBaseItemComparer
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The name.</value>
|
||||||
|
public string Name => ItemSortBy.CommunityRating;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compares the specified x.
|
/// Compares the specified x.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -16,18 +24,16 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
public int Compare(BaseItem x, BaseItem y)
|
public int Compare(BaseItem x, BaseItem y)
|
||||||
{
|
{
|
||||||
if (x == null)
|
if (x == null)
|
||||||
|
{
|
||||||
throw new ArgumentNullException(nameof(x));
|
throw new ArgumentNullException(nameof(x));
|
||||||
|
}
|
||||||
|
|
||||||
if (y == null)
|
if (y == null)
|
||||||
|
{
|
||||||
throw new ArgumentNullException(nameof(y));
|
throw new ArgumentNullException(nameof(y));
|
||||||
|
}
|
||||||
|
|
||||||
return (x.CommunityRating ?? 0).CompareTo(y.CommunityRating ?? 0);
|
return (x.CommunityRating ?? 0).CompareTo(y.CommunityRating ?? 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the name.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The name.</value>
|
|
||||||
public string Name => ItemSortBy.CommunityRating;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
@ -26,6 +28,12 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
/// <value>The user data repository.</value>
|
/// <value>The user data repository.</value>
|
||||||
public IUserDataManager UserDataRepository { get; set; }
|
public IUserDataManager UserDataRepository { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The name.</value>
|
||||||
|
public string Name => ItemSortBy.DateLastContentAdded;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compares the specified x.
|
/// Compares the specified x.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -44,9 +52,7 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
/// <returns>DateTime.</returns>
|
/// <returns>DateTime.</returns>
|
||||||
private static DateTime GetDate(BaseItem x)
|
private static DateTime GetDate(BaseItem x)
|
||||||
{
|
{
|
||||||
var folder = x as Folder;
|
if (x is Folder folder)
|
||||||
|
|
||||||
if (folder != null)
|
|
||||||
{
|
{
|
||||||
if (folder.DateLastMediaAdded.HasValue)
|
if (folder.DateLastMediaAdded.HasValue)
|
||||||
{
|
{
|
||||||
@ -56,11 +62,5 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
|
|
||||||
return DateTime.MinValue;
|
return DateTime.MinValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the name.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The name.</value>
|
|
||||||
public string Name => ItemSortBy.DateLastContentAdded;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.Sorting;
|
using MediaBrowser.Controller.Sorting;
|
||||||
@ -13,6 +15,24 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
/// <value>The user.</value>
|
/// <value>The user.</value>
|
||||||
public User User { get; set; }
|
public User User { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The name.</value>
|
||||||
|
public string Name => ItemSortBy.IsFavoriteOrLiked;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the user data repository.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The user data repository.</value>
|
||||||
|
public IUserDataManager UserDataRepository { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the user manager.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The user manager.</value>
|
||||||
|
public IUserManager UserManager { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compares the specified x.
|
/// Compares the specified x.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -33,23 +53,5 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
{
|
{
|
||||||
return x.IsFavoriteOrLiked(User) ? 0 : 1;
|
return x.IsFavoriteOrLiked(User) ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the name.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The name.</value>
|
|
||||||
public string Name => ItemSortBy.IsFavoriteOrLiked;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the user data repository.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The user data repository.</value>
|
|
||||||
public IUserDataManager UserDataRepository { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the user manager.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The user manager.</value>
|
|
||||||
public IUserManager UserManager { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Sorting;
|
using MediaBrowser.Controller.Sorting;
|
||||||
using MediaBrowser.Model.Querying;
|
using MediaBrowser.Model.Querying;
|
||||||
@ -6,6 +8,12 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
{
|
{
|
||||||
public class IsFolderComparer : IBaseItemComparer
|
public class IsFolderComparer : IBaseItemComparer
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The name.</value>
|
||||||
|
public string Name => ItemSortBy.IsFolder;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compares the specified x.
|
/// Compares the specified x.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -26,11 +34,5 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
{
|
{
|
||||||
return x.IsFolder ? 0 : 1;
|
return x.IsFolder ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the name.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The name.</value>
|
|
||||||
public string Name => ItemSortBy.IsFolder;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.Sorting;
|
using MediaBrowser.Controller.Sorting;
|
||||||
@ -13,6 +15,24 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
/// <value>The user.</value>
|
/// <value>The user.</value>
|
||||||
public User User { get; set; }
|
public User User { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The name.</value>
|
||||||
|
public string Name => ItemSortBy.IsUnplayed;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the user data repository.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The user data repository.</value>
|
||||||
|
public IUserDataManager UserDataRepository { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the user manager.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The user manager.</value>
|
||||||
|
public IUserManager UserManager { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compares the specified x.
|
/// Compares the specified x.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -33,23 +53,5 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
{
|
{
|
||||||
return x.IsPlayed(User) ? 0 : 1;
|
return x.IsPlayed(User) ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the name.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The name.</value>
|
|
||||||
public string Name => ItemSortBy.IsUnplayed;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the user data repository.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The user data repository.</value>
|
|
||||||
public IUserDataManager UserDataRepository { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the user manager.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The user manager.</value>
|
|
||||||
public IUserManager UserManager { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.Sorting;
|
using MediaBrowser.Controller.Sorting;
|
||||||
@ -13,6 +15,24 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
/// <value>The user.</value>
|
/// <value>The user.</value>
|
||||||
public User User { get; set; }
|
public User User { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The name.</value>
|
||||||
|
public string Name => ItemSortBy.IsUnplayed;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the user data repository.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The user data repository.</value>
|
||||||
|
public IUserDataManager UserDataRepository { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the user manager.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The user manager.</value>
|
||||||
|
public IUserManager UserManager { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compares the specified x.
|
/// Compares the specified x.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -33,23 +53,5 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
{
|
{
|
||||||
return x.IsUnplayed(User) ? 0 : 1;
|
return x.IsUnplayed(User) ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the name.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The name.</value>
|
|
||||||
public string Name => ItemSortBy.IsUnplayed;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the user data repository.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The user data repository.</value>
|
|
||||||
public IUserDataManager UserDataRepository { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the user manager.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The user manager.</value>
|
|
||||||
public IUserManager UserManager { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Sorting;
|
using MediaBrowser.Controller.Sorting;
|
||||||
@ -15,6 +17,12 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
_localization = localization;
|
_localization = localization;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The name.</value>
|
||||||
|
public string Name => ItemSortBy.OfficialRating;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compares the specified x.
|
/// Compares the specified x.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -38,11 +46,5 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
|
|
||||||
return levelX.CompareTo(levelY);
|
return levelX.CompareTo(levelY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the name.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The name.</value>
|
|
||||||
public string Name => ItemSortBy.OfficialRating;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Sorting;
|
using MediaBrowser.Controller.Sorting;
|
||||||
@ -7,6 +9,12 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
{
|
{
|
||||||
public class SeriesSortNameComparer : IBaseItemComparer
|
public class SeriesSortNameComparer : IBaseItemComparer
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The name.</value>
|
||||||
|
public string Name => ItemSortBy.SeriesSortName;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compares the specified x.
|
/// Compares the specified x.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -18,12 +26,6 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
return string.Compare(GetValue(x), GetValue(y), StringComparison.CurrentCultureIgnoreCase);
|
return string.Compare(GetValue(x), GetValue(y), StringComparison.CurrentCultureIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the name.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The name.</value>
|
|
||||||
public string Name => ItemSortBy.SeriesSortName;
|
|
||||||
|
|
||||||
private static string GetValue(BaseItem item)
|
private static string GetValue(BaseItem item)
|
||||||
{
|
{
|
||||||
var hasSeries = item as IHasSeries;
|
var hasSeries = item as IHasSeries;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.LiveTv;
|
using MediaBrowser.Controller.LiveTv;
|
||||||
@ -8,6 +10,12 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
{
|
{
|
||||||
public class StartDateComparer : IBaseItemComparer
|
public class StartDateComparer : IBaseItemComparer
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The name.</value>
|
||||||
|
public string Name => ItemSortBy.StartDate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compares the specified x.
|
/// Compares the specified x.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -26,19 +34,12 @@ namespace Emby.Server.Implementations.Sorting
|
|||||||
/// <returns>DateTime.</returns>
|
/// <returns>DateTime.</returns>
|
||||||
private static DateTime GetDate(BaseItem x)
|
private static DateTime GetDate(BaseItem x)
|
||||||
{
|
{
|
||||||
var hasStartDate = x as LiveTvProgram;
|
if (x is LiveTvProgram hasStartDate)
|
||||||
|
|
||||||
if (hasStartDate != null)
|
|
||||||
{
|
{
|
||||||
return hasStartDate.StartDate;
|
return hasStartDate.StartDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DateTime.MinValue;
|
return DateTime.MinValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the name.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The name.</value>
|
|
||||||
public string Name => ItemSortBy.StartDate;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
|
@ -65,6 +65,11 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool IsGroupEmpty() => _group.IsEmpty();
|
public bool IsGroupEmpty() => _group.IsEmpty();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="SyncPlayController" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sessionManager">The session manager.</param>
|
||||||
|
/// <param name="syncPlayManager">The SyncPlay manager.</param>
|
||||||
public SyncPlayController(
|
public SyncPlayController(
|
||||||
ISessionManager sessionManager,
|
ISessionManager sessionManager,
|
||||||
ISyncPlayManager syncPlayManager)
|
ISyncPlayManager syncPlayManager)
|
||||||
|
@ -57,6 +57,13 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||||||
|
|
||||||
private bool _disposed = false;
|
private bool _disposed = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="SyncPlayManager" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="logger">The logger.</param>
|
||||||
|
/// <param name="userManager">The user manager.</param>
|
||||||
|
/// <param name="sessionManager">The session manager.</param>
|
||||||
|
/// <param name="libraryManager">The library manager.</param>
|
||||||
public SyncPlayManager(
|
public SyncPlayManager(
|
||||||
ILogger<SyncPlayManager> logger,
|
ILogger<SyncPlayManager> logger,
|
||||||
IUserManager userManager,
|
IUserManager userManager,
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using MediaBrowser.Controller.Configuration;
|
|
||||||
using MediaBrowser.Controller.Dto;
|
using MediaBrowser.Controller.Dto;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Entities.TV;
|
using MediaBrowser.Controller.Entities.TV;
|
||||||
@ -18,14 +19,12 @@ namespace Emby.Server.Implementations.TV
|
|||||||
private readonly IUserManager _userManager;
|
private readonly IUserManager _userManager;
|
||||||
private readonly IUserDataManager _userDataManager;
|
private readonly IUserDataManager _userDataManager;
|
||||||
private readonly ILibraryManager _libraryManager;
|
private readonly ILibraryManager _libraryManager;
|
||||||
private readonly IServerConfigurationManager _config;
|
|
||||||
|
|
||||||
public TVSeriesManager(IUserManager userManager, IUserDataManager userDataManager, ILibraryManager libraryManager, IServerConfigurationManager config)
|
public TVSeriesManager(IUserManager userManager, IUserDataManager userDataManager, ILibraryManager libraryManager)
|
||||||
{
|
{
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
_userDataManager = userDataManager;
|
_userDataManager = userDataManager;
|
||||||
_libraryManager = libraryManager;
|
_libraryManager = libraryManager;
|
||||||
_config = config;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryResult<BaseItem> GetNextUp(NextUpQuery request, DtoOptions dtoOptions)
|
public QueryResult<BaseItem> GetNextUp(NextUpQuery request, DtoOptions dtoOptions)
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@ -19,13 +21,11 @@ namespace Emby.Server.Implementations.UserViews
|
|||||||
public class DynamicImageProvider : BaseDynamicImageProvider<UserView>
|
public class DynamicImageProvider : BaseDynamicImageProvider<UserView>
|
||||||
{
|
{
|
||||||
private readonly IUserManager _userManager;
|
private readonly IUserManager _userManager;
|
||||||
private readonly ILibraryManager _libraryManager;
|
|
||||||
|
|
||||||
public DynamicImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor, IUserManager userManager, ILibraryManager libraryManager)
|
public DynamicImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor, IUserManager userManager)
|
||||||
: base(fileSystem, providerManager, applicationPaths, imageProcessor)
|
: base(fileSystem, providerManager, applicationPaths, imageProcessor)
|
||||||
{
|
{
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
_libraryManager = libraryManager;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IReadOnlyList<BaseItem> GetItemsWithImages(BaseItem item)
|
protected override IReadOnlyList<BaseItem> GetItemsWithImages(BaseItem item)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Emby.Server.Implementations.Images;
|
using Emby.Server.Implementations.Images;
|
||||||
using MediaBrowser.Common.Configuration;
|
using MediaBrowser.Common.Configuration;
|
||||||
@ -75,14 +77,14 @@ namespace Emby.Server.Implementations.UserViews
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var folder = item as Folder;
|
if (item is Folder folder)
|
||||||
if (folder != null)
|
|
||||||
{
|
{
|
||||||
if (folder.IsTopParent)
|
if (folder.IsTopParent)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
//return item.SourceType == SourceType.Library;
|
//return item.SourceType == SourceType.Library;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace Jellyfin.Server.Migrations
|
namespace Jellyfin.Server.Migrations
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using MediaBrowser.Common.Configuration;
|
using MediaBrowser.Common.Configuration;
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace Jellyfin.Server.Migrations.Routines
|
namespace Jellyfin.Server.Migrations.Routines
|
||||||
|
@ -40,12 +40,12 @@ namespace Jellyfin.Server
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The name of logging configuration file containing application defaults.
|
/// The name of logging configuration file containing application defaults.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly string LoggingConfigFileDefault = "logging.default.json";
|
public const string LoggingConfigFileDefault = "logging.default.json";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The name of the logging configuration file containing the system-specific override settings.
|
/// The name of the logging configuration file containing the system-specific override settings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly string LoggingConfigFileSystem = "logging.json";
|
public const string LoggingConfigFileSystem = "logging.json";
|
||||||
|
|
||||||
private static readonly CancellationTokenSource _tokenSource = new CancellationTokenSource();
|
private static readonly CancellationTokenSource _tokenSource = new CancellationTokenSource();
|
||||||
private static readonly ILoggerFactory _loggerFactory = new SerilogLoggerFactory();
|
private static readonly ILoggerFactory _loggerFactory = new SerilogLoggerFactory();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user