aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Entities/AggregateFolder.cs2
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs4
-rw-r--r--MediaBrowser.Controller/Entities/CollectionFolder.cs2
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs12
-rw-r--r--MediaBrowser.Controller/Entities/ICollectionFolder.cs3
-rw-r--r--MediaBrowser.Controller/Entities/User.cs2
-rw-r--r--MediaBrowser.Controller/Entities/UserView.cs16
-rw-r--r--MediaBrowser.Controller/IServerApplicationPaths.cs8
-rw-r--r--MediaBrowser.Controller/Library/IUserManager.cs10
-rw-r--r--MediaBrowser.Controller/MediaBrowser.Controller.csproj2
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs4
-rw-r--r--MediaBrowser.Controller/Providers/DirectoryService.cs9
-rw-r--r--MediaBrowser.Controller/Subtitles/ISubtitleManager.cs10
13 files changed, 45 insertions, 39 deletions
diff --git a/MediaBrowser.Controller/Entities/AggregateFolder.cs b/MediaBrowser.Controller/Entities/AggregateFolder.cs
index cacda8140..54540e892 100644
--- a/MediaBrowser.Controller/Entities/AggregateFolder.cs
+++ b/MediaBrowser.Controller/Entities/AggregateFolder.cs
@@ -89,7 +89,7 @@ namespace MediaBrowser.Controller.Entities
{
var locations = PhysicalLocations;
- var newLocations = CreateResolveArgs(new DirectoryService(Logger, FileSystem), false).PhysicalLocations;
+ var newLocations = CreateResolveArgs(new DirectoryService(FileSystem), false).PhysicalLocations;
if (!locations.SequenceEqual(newLocations))
{
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 599d41bb2..1fd706857 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -1344,7 +1344,7 @@ namespace MediaBrowser.Controller.Entities
public Task RefreshMetadata(CancellationToken cancellationToken)
{
- return RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(Logger, FileSystem)), cancellationToken);
+ return RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(FileSystem)), cancellationToken);
}
protected virtual void TriggerOnRefreshStart()
@@ -2197,7 +2197,7 @@ namespace MediaBrowser.Controller.Entities
/// <returns>Task.</returns>
public virtual void ChangedExternally()
{
- ProviderManager.QueueRefresh(Id, new MetadataRefreshOptions(new DirectoryService(Logger, FileSystem))
+ ProviderManager.QueueRefresh(Id, new MetadataRefreshOptions(new DirectoryService(FileSystem))
{
}, RefreshPriority.High);
diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs
index bc5e7467e..e5adf88d1 100644
--- a/MediaBrowser.Controller/Entities/CollectionFolder.cs
+++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs
@@ -171,7 +171,7 @@ namespace MediaBrowser.Controller.Entities
{
var locations = PhysicalLocations;
- var newLocations = CreateResolveArgs(new DirectoryService(Logger, FileSystem), false).PhysicalLocations;
+ var newLocations = CreateResolveArgs(new DirectoryService(FileSystem), false).PhysicalLocations;
if (!locations.SequenceEqual(newLocations))
{
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index 61cc208d7..07fbe6035 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -216,7 +216,7 @@ namespace MediaBrowser.Controller.Entities
public Task ValidateChildren(IProgress<double> progress, CancellationToken cancellationToken)
{
- return ValidateChildren(progress, cancellationToken, new MetadataRefreshOptions(new DirectoryService(Logger, FileSystem)));
+ return ValidateChildren(progress, cancellationToken, new MetadataRefreshOptions(new DirectoryService(FileSystem)));
}
/// <summary>
@@ -1152,6 +1152,11 @@ namespace MediaBrowser.Controller.Entities
public List<BaseItem> GetChildren(User user, bool includeLinkedChildren)
{
+ if (user == null)
+ {
+ throw new ArgumentNullException(nameof(user));
+ }
+
return GetChildren(user, includeLinkedChildren, null);
}
@@ -1163,7 +1168,10 @@ namespace MediaBrowser.Controller.Entities
}
//the true root should return our users root folder children
- if (IsPhysicalRoot) return LibraryManager.GetUserRootFolder().GetChildren(user, includeLinkedChildren);
+ if (IsPhysicalRoot)
+ {
+ return LibraryManager.GetUserRootFolder().GetChildren(user, includeLinkedChildren);
+ }
var result = new Dictionary<Guid, BaseItem>();
diff --git a/MediaBrowser.Controller/Entities/ICollectionFolder.cs b/MediaBrowser.Controller/Entities/ICollectionFolder.cs
index a6a9a0783..4f0760746 100644
--- a/MediaBrowser.Controller/Entities/ICollectionFolder.cs
+++ b/MediaBrowser.Controller/Entities/ICollectionFolder.cs
@@ -8,8 +8,11 @@ namespace MediaBrowser.Controller.Entities
public interface ICollectionFolder : IHasCollectionType
{
string Path { get; }
+
string Name { get; }
+
Guid Id { get; }
+
string[] PhysicalLocations { get; }
}
diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs
index c70ecccf1..53601a610 100644
--- a/MediaBrowser.Controller/Entities/User.cs
+++ b/MediaBrowser.Controller/Entities/User.cs
@@ -148,7 +148,7 @@ namespace MediaBrowser.Controller.Entities
Name = newName;
return RefreshMetadata(
- new MetadataRefreshOptions(new DirectoryService(Logger, FileSystem))
+ new MetadataRefreshOptions(new DirectoryService(FileSystem))
{
ReplaceAllMetadata = true,
ImageRefreshMode = MetadataRefreshMode.FullRefresh,
diff --git a/MediaBrowser.Controller/Entities/UserView.cs b/MediaBrowser.Controller/Entities/UserView.cs
index fd045f0dd..4ce9ec6f8 100644
--- a/MediaBrowser.Controller/Entities/UserView.cs
+++ b/MediaBrowser.Controller/Entities/UserView.cs
@@ -10,34 +10,36 @@ namespace MediaBrowser.Controller.Entities
{
public class UserView : Folder, IHasCollectionType
{
+ /// <inheritdoc />
public string ViewType { get; set; }
+
+ /// <inheritdoc />
public new Guid DisplayParentId { get; set; }
+ /// <inheritdoc />
public Guid? UserId { get; set; }
public static ITVSeriesManager TVSeriesManager;
+ /// <inheritdoc />
[JsonIgnore]
public string CollectionType => ViewType;
+ /// <inheritdoc />
public override IEnumerable<Guid> GetIdsForAncestorQuery()
{
- var list = new List<Guid>();
-
if (!DisplayParentId.Equals(Guid.Empty))
{
- list.Add(DisplayParentId);
+ yield return DisplayParentId;
}
else if (!ParentId.Equals(Guid.Empty))
{
- list.Add(ParentId);
+ yield return ParentId;
}
else
{
- list.Add(Id);
+ yield return Id;
}
-
- return list;
}
[JsonIgnore]
diff --git a/MediaBrowser.Controller/IServerApplicationPaths.cs b/MediaBrowser.Controller/IServerApplicationPaths.cs
index 15d7e9f62..56e7e4e47 100644
--- a/MediaBrowser.Controller/IServerApplicationPaths.cs
+++ b/MediaBrowser.Controller/IServerApplicationPaths.cs
@@ -83,12 +83,6 @@ namespace MediaBrowser.Controller
string UserConfigurationDirectoryPath { get; }
/// <summary>
- /// Gets the transcoding temporary path.
- /// </summary>
- /// <value>The transcoding temporary path.</value>
- string TranscodingTempPath { get; }
-
- /// <summary>
/// Gets the internal metadata path.
/// </summary>
/// <value>The internal metadata path.</value>
@@ -96,7 +90,5 @@ namespace MediaBrowser.Controller
string VirtualInternalMetadataPath { get; }
string ArtistsPath { get; }
-
- string GetTranscodingTempPath();
}
}
diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.cs
index bbedc0442..eea2e3a71 100644
--- a/MediaBrowser.Controller/Library/IUserManager.cs
+++ b/MediaBrowser.Controller/Library/IUserManager.cs
@@ -39,17 +39,21 @@ namespace MediaBrowser.Controller.Library
event EventHandler<GenericEventArgs<User>> UserDeleted;
event EventHandler<GenericEventArgs<User>> UserCreated;
+
event EventHandler<GenericEventArgs<User>> UserPolicyUpdated;
+
event EventHandler<GenericEventArgs<User>> UserConfigurationUpdated;
+
event EventHandler<GenericEventArgs<User>> UserPasswordChanged;
+
event EventHandler<GenericEventArgs<User>> UserLockedOut;
/// <summary>
- /// Gets a User by Id
+ /// Gets a User by Id.
/// </summary>
/// <param name="id">The id.</param>
- /// <returns>User.</returns>
- /// <exception cref="ArgumentNullException"></exception>
+ /// <returns>The user with the specified Id, or <c>null</c> if the user doesn't exist.</returns>
+ /// <exception cref="ArgumentException"><c>id</c> is an empty Guid.</exception>
User GetUserById(Guid id);
/// <summary>
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index c6bca2518..276eb71bc 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -17,7 +17,7 @@
</ItemGroup>
<PropertyGroup>
- <TargetFramework>netstandard2.0</TargetFramework>
+ <TargetFramework>netstandard2.1</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index d896a7aef..349e371a7 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -10,7 +10,6 @@ using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.MediaInfo;
@@ -2168,7 +2167,8 @@ namespace MediaBrowser.Controller.MediaEncoding
// Important: If this is ever re-enabled, make sure not to use it with wtv because it breaks seeking
if (!string.Equals(state.InputContainer, "wtv", StringComparison.OrdinalIgnoreCase)
&& state.TranscodingType != TranscodingJobType.Progressive
- && state.EnableBreakOnNonKeyFrames(outputVideoCodec))
+ && !state.EnableBreakOnNonKeyFrames(outputVideoCodec)
+ && (state.BaseRequest.StartTimeTicks ?? 0) > 0)
{
inputModifier += " -noaccurate_seek";
}
diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs
index 133e7c115..303b03a21 100644
--- a/MediaBrowser.Controller/Providers/DirectoryService.cs
+++ b/MediaBrowser.Controller/Providers/DirectoryService.cs
@@ -2,13 +2,11 @@ using System;
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.IO;
-using Microsoft.Extensions.Logging;
namespace MediaBrowser.Controller.Providers
{
public class DirectoryService : IDirectoryService
{
- private readonly ILogger _logger;
private readonly IFileSystem _fileSystem;
private readonly Dictionary<string, FileSystemMetadata[]> _cache = new Dictionary<string, FileSystemMetadata[]>(StringComparer.OrdinalIgnoreCase);
@@ -17,9 +15,8 @@ namespace MediaBrowser.Controller.Providers
private readonly Dictionary<string, List<string>> _filePathCache = new Dictionary<string, List<string>>(StringComparer.OrdinalIgnoreCase);
- public DirectoryService(ILogger logger, IFileSystem fileSystem)
+ public DirectoryService(IFileSystem fileSystem)
{
- _logger = logger;
_fileSystem = fileSystem;
}
@@ -27,8 +24,6 @@ namespace MediaBrowser.Controller.Providers
{
if (!_cache.TryGetValue(path, out FileSystemMetadata[] entries))
{
- //_logger.LogDebug("Getting files for " + path);
-
entries = _fileSystem.GetFileSystemEntries(path).ToArray();
//_cache.TryAdd(path, entries);
@@ -49,6 +44,7 @@ namespace MediaBrowser.Controller.Providers
list.Add(item);
}
}
+
return list;
}
@@ -89,6 +85,5 @@ namespace MediaBrowser.Controller.Providers
return result;
}
-
}
}
diff --git a/MediaBrowser.Controller/Subtitles/ISubtitleManager.cs b/MediaBrowser.Controller/Subtitles/ISubtitleManager.cs
index 0872335c5..39538aacd 100644
--- a/MediaBrowser.Controller/Subtitles/ISubtitleManager.cs
+++ b/MediaBrowser.Controller/Subtitles/ISubtitleManager.cs
@@ -24,7 +24,8 @@ namespace MediaBrowser.Controller.Subtitles
/// <summary>
/// Searches the subtitles.
/// </summary>
- Task<RemoteSubtitleInfo[]> SearchSubtitles(Video video,
+ Task<RemoteSubtitleInfo[]> SearchSubtitles(
+ Video video,
string language,
bool? isPerfectMatch,
CancellationToken cancellationToken);
@@ -34,8 +35,9 @@ namespace MediaBrowser.Controller.Subtitles
/// </summary>
/// <param name="request">The request.</param>
/// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task{IEnumerable{RemoteSubtitleInfo}}.</returns>
- Task<RemoteSubtitleInfo[]> SearchSubtitles(SubtitleSearchRequest request,
+ /// <returns>Task{RemoteSubtitleInfo[]}.</returns>
+ Task<RemoteSubtitleInfo[]> SearchSubtitles(
+ SubtitleSearchRequest request,
CancellationToken cancellationToken);
/// <summary>
@@ -53,7 +55,7 @@ namespace MediaBrowser.Controller.Subtitles
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task{SubtitleResponse}.</returns>
+ /// <returns><see cref="Task{SubtitleResponse}" />.</returns>
Task<SubtitleResponse> GetRemoteSubtitles(string id, CancellationToken cancellationToken);
/// <summary>