Minor improvements

This commit is contained in:
Bond_009 2019-12-26 23:20:31 +01:00 committed by dkanada
parent a253fa616d
commit 8a0ef41036
5 changed files with 10 additions and 10 deletions

View File

@ -6211,7 +6211,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
public void SaveMediaAttachments( public void SaveMediaAttachments(
Guid id, Guid id,
List<MediaAttachment> attachments, IReadOnlyList<MediaAttachment> attachments,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{ {
CheckDisposed(); CheckDisposed();
@ -6243,7 +6243,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
private void InsertMediaAttachments( private void InsertMediaAttachments(
byte[] idBlob, byte[] idBlob,
List<MediaAttachment> attachments, IReadOnlyList<MediaAttachment> attachments,
IDatabaseConnection db, IDatabaseConnection db,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{ {

View File

@ -91,7 +91,7 @@ namespace MediaBrowser.Controller.Persistence
/// <param name="id">The identifier.</param> /// <param name="id">The identifier.</param>
/// <param name="attachments">The attachments.</param> /// <param name="attachments">The attachments.</param>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
void SaveMediaAttachments(Guid id, List<MediaAttachment> attachments, CancellationToken cancellationToken); void SaveMediaAttachments(Guid id, IReadOnlyList<MediaAttachment> attachments, CancellationToken cancellationToken);
/// <summary> /// <summary>
/// Gets the item ids. /// Gets the item ids.

View File

@ -43,7 +43,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
/// </summary> /// </summary>
/// <param name="path">The path.</param> /// <param name="path">The path.</param>
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
public static string GetFileInputArgument(string path) private static string GetFileInputArgument(string path)
{ {
if (path.IndexOf("://") != -1) if (path.IndexOf("://") != -1)
{ {

View File

@ -57,7 +57,7 @@ namespace MediaBrowser.Model.Dto
public List<MediaStream> MediaStreams { get; set; } public List<MediaStream> MediaStreams { get; set; }
public List<MediaAttachment> MediaAttachments { get; set; } public IReadOnlyList<MediaAttachment> MediaAttachments { get; set; }
public string[] Formats { get; set; } public string[] Formats { get; set; }

View File

@ -158,7 +158,7 @@ namespace MediaBrowser.Providers.MediaInfo
MetadataRefreshOptions options) MetadataRefreshOptions options)
{ {
List<MediaStream> mediaStreams; List<MediaStream> mediaStreams;
List<MediaAttachment> mediaAttachments; IReadOnlyList<MediaAttachment> mediaAttachments;
List<ChapterInfo> chapters; List<ChapterInfo> chapters;
if (mediaInfo != null) if (mediaInfo != null)
@ -200,7 +200,7 @@ namespace MediaBrowser.Providers.MediaInfo
else else
{ {
mediaStreams = new List<MediaStream>(); mediaStreams = new List<MediaStream>();
mediaAttachments = new List<MediaAttachment>(); mediaAttachments = Array.Empty<MediaAttachment>();
chapters = new List<ChapterInfo>(); chapters = new List<ChapterInfo>();
} }
@ -213,13 +213,13 @@ namespace MediaBrowser.Providers.MediaInfo
FetchEmbeddedInfo(video, mediaInfo, options, libraryOptions); FetchEmbeddedInfo(video, mediaInfo, options, libraryOptions);
FetchPeople(video, mediaInfo, options); FetchPeople(video, mediaInfo, options);
video.Timestamp = mediaInfo.Timestamp; video.Timestamp = mediaInfo.Timestamp;
video.Video3DFormat = video.Video3DFormat ?? mediaInfo.Video3DFormat; video.Video3DFormat ??= mediaInfo.Video3DFormat;
} }
var videoStream = mediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Video); var videoStream = mediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Video);
video.Height = videoStream == null ? 0 : videoStream.Height ?? 0; video.Height = videoStream?.Height ?? 0;
video.Width = videoStream == null ? 0 : videoStream.Width ?? 0; video.Width = videoStream?.Width ?? 0;
video.DefaultVideoStreamIndex = videoStream == null ? (int?)null : videoStream.Index; video.DefaultVideoStreamIndex = videoStream == null ? (int?)null : videoStream.Index;