aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/VideosService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/VideosService.cs')
-rw-r--r--MediaBrowser.Api/VideosService.cs24
1 files changed, 12 insertions, 12 deletions
diff --git a/MediaBrowser.Api/VideosService.cs b/MediaBrowser.Api/VideosService.cs
index 474036f5c..46b6d5a94 100644
--- a/MediaBrowser.Api/VideosService.cs
+++ b/MediaBrowser.Api/VideosService.cs
@@ -7,11 +7,10 @@ using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Net;
-using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.IO;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Services;
+using Microsoft.Extensions.Logging;
namespace MediaBrowser.Api
{
@@ -51,19 +50,21 @@ namespace MediaBrowser.Api
private readonly ILibraryManager _libraryManager;
private readonly IUserManager _userManager;
private readonly IDtoService _dtoService;
- private readonly IFileSystem _fileSystem;
- private readonly IItemRepository _itemRepo;
- private readonly IServerConfigurationManager _config;
private readonly IAuthorizationContext _authContext;
- public VideosService(ILibraryManager libraryManager, IUserManager userManager, IDtoService dtoService, IItemRepository itemRepo, IFileSystem fileSystem, IServerConfigurationManager config, IAuthorizationContext authContext)
+ public VideosService(
+ ILogger<VideosService> logger,
+ IServerConfigurationManager serverConfigurationManager,
+ IHttpResultFactory httpResultFactory,
+ ILibraryManager libraryManager,
+ IUserManager userManager,
+ IDtoService dtoService,
+ IAuthorizationContext authContext)
+ : base(logger, serverConfigurationManager, httpResultFactory)
{
_libraryManager = libraryManager;
_userManager = userManager;
_dtoService = dtoService;
- _itemRepo = itemRepo;
- _fileSystem = fileSystem;
- _config = config;
_authContext = authContext;
}
@@ -84,9 +85,8 @@ namespace MediaBrowser.Api
var dtoOptions = GetDtoOptions(_authContext, request);
- var video = item as Video;
BaseItemDto[] items;
- if (video != null)
+ if (item is Video video)
{
items = video.GetAdditionalParts()
.Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, video))
@@ -94,7 +94,7 @@ namespace MediaBrowser.Api
}
else
{
- items = new BaseItemDto[] { };
+ items = Array.Empty<BaseItemDto>();
}
var result = new QueryResult<BaseItemDto>