aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Dto/DtoOptions.cs14
-rw-r--r--MediaBrowser.Controller/Dto/IDtoService.cs4
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs24
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs2
-rw-r--r--MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs5
-rw-r--r--MediaBrowser.Controller/MediaEncoding/JobLogger.cs11
-rw-r--r--MediaBrowser.Controller/Security/IEncryptionManager.cs19
7 files changed, 16 insertions, 63 deletions
diff --git a/MediaBrowser.Controller/Dto/DtoOptions.cs b/MediaBrowser.Controller/Dto/DtoOptions.cs
index aa99f6b58..cdaf95f5c 100644
--- a/MediaBrowser.Controller/Dto/DtoOptions.cs
+++ b/MediaBrowser.Controller/Dto/DtoOptions.cs
@@ -36,9 +36,7 @@ namespace MediaBrowser.Controller.Dto
.ToArray();
public bool ContainsField(ItemFields field)
- {
- return AllItemFields.Contains(field);
- }
+ => Fields.Contains(field);
public DtoOptions(bool allFields)
{
@@ -47,15 +45,7 @@ namespace MediaBrowser.Controller.Dto
EnableUserData = true;
AddCurrentProgram = true;
- if (allFields)
- {
- Fields = AllItemFields;
- }
- else
- {
- Fields = new ItemFields[] { };
- }
-
+ Fields = allFields ? AllItemFields : Array.Empty<ItemFields>();
ImageTypes = AllImageTypes;
}
diff --git a/MediaBrowser.Controller/Dto/IDtoService.cs b/MediaBrowser.Controller/Dto/IDtoService.cs
index df5ec5dd0..4b6fd58fe 100644
--- a/MediaBrowser.Controller/Dto/IDtoService.cs
+++ b/MediaBrowser.Controller/Dto/IDtoService.cs
@@ -57,9 +57,7 @@ namespace MediaBrowser.Controller.Dto
/// <param name="options">The options.</param>
/// <param name="user">The user.</param>
/// <param name="owner">The owner.</param>
- BaseItemDto[] GetBaseItemDtos(BaseItem[] items, DtoOptions options, User user = null, BaseItem owner = null);
-
- BaseItemDto[] GetBaseItemDtos(List<BaseItem> items, DtoOptions options, User user = null, BaseItem owner = null);
+ BaseItemDto[] GetBaseItemDtos(IReadOnlyList<BaseItem> items, DtoOptions options, User user = null, BaseItem owner = null);
/// <summary>
/// Gets the item by name dto.
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index 8bfadbee6..e49ff20ba 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -810,37 +810,19 @@ namespace MediaBrowser.Controller.Entities
{
if (query.ItemIds.Length > 0)
{
- var result = LibraryManager.GetItemsResult(query);
-
- if (query.OrderBy.Length == 0)
- {
- var ids = query.ItemIds.ToList();
-
- // Try to preserve order
- result.Items = result.Items.OrderBy(i => ids.IndexOf(i.Id)).ToArray();
- }
- return result;
+ return LibraryManager.GetItemsResult(query);
}
return GetItemsInternal(query);
}
- public BaseItem[] GetItemList(InternalItemsQuery query)
+ public IReadOnlyList<BaseItem> GetItemList(InternalItemsQuery query)
{
query.EnableTotalRecordCount = false;
if (query.ItemIds.Length > 0)
{
- var result = LibraryManager.GetItemList(query);
-
- if (query.OrderBy.Length == 0)
- {
- var ids = query.ItemIds.ToList();
-
- // Try to preserve order
- return result.OrderBy(i => ids.IndexOf(i.Id)).ToArray();
- }
- return result.ToArray();
+ return LibraryManager.GetItemList(query);
}
return GetItemsInternal(query).Items;
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index f5f147db1..e378c2b89 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -1904,7 +1904,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
flags.Add("+ignidx");
}
- if (state.GenPtsInput)
+ if (state.GenPtsInput || string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
{
flags.Add("+genpts");
}
diff --git a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
index 057e43910..d4ac3b7c3 100644
--- a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
+++ b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
@@ -6,6 +6,7 @@ using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.MediaInfo;
+using MediaBrowser.Model.System;
namespace MediaBrowser.Controller.MediaEncoding
{
@@ -14,7 +15,7 @@ namespace MediaBrowser.Controller.MediaEncoding
/// </summary>
public interface IMediaEncoder : ITranscoderSupport
{
- string EncoderLocationType { get; }
+ FFmpegLocation EncoderLocation { get; }
/// <summary>
/// Gets the encoder path.
@@ -91,7 +92,7 @@ namespace MediaBrowser.Controller.MediaEncoding
/// <returns>System.String.</returns>
string EscapeSubtitleFilterPath(string path);
- void Init();
+ void SetFFmpegPath();
void UpdateEncoderPath(string path, string pathType);
bool SupportsEncoder(string encoder);
diff --git a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs
index b812a8ddc..46593fb2f 100644
--- a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs
+++ b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs
@@ -32,16 +32,17 @@ namespace MediaBrowser.Controller.MediaEncoding
var bytes = Encoding.UTF8.GetBytes(Environment.NewLine + line);
+ // If ffmpeg process is closed, the state is disposed, so don't write to target in that case
+ if (!target.CanWrite)
+ {
+ break;
+ }
+
await target.WriteAsync(bytes, 0, bytes.Length).ConfigureAwait(false);
await target.FlushAsync().ConfigureAwait(false);
}
}
}
- catch (ObjectDisposedException)
- {
- //TODO Investigate and properly fix.
- // Don't spam the log. This doesn't seem to throw in windows, but sometimes under linux
- }
catch (Exception ex)
{
_logger.LogError(ex, "Error reading ffmpeg log");
diff --git a/MediaBrowser.Controller/Security/IEncryptionManager.cs b/MediaBrowser.Controller/Security/IEncryptionManager.cs
deleted file mode 100644
index 68680fdf3..000000000
--- a/MediaBrowser.Controller/Security/IEncryptionManager.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-namespace MediaBrowser.Controller.Security
-{
- public interface IEncryptionManager
- {
- /// <summary>
- /// Encrypts the string.
- /// </summary>
- /// <param name="value">The value.</param>
- /// <returns>System.String.</returns>
- string EncryptString(string value);
-
- /// <summary>
- /// Decrypts the string.
- /// </summary>
- /// <param name="value">The value.</param>
- /// <returns>System.String.</returns>
- string DecryptString(string value);
- }
-}