diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2020-01-08 11:04:21 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-08 11:04:21 +0900 |
| commit | 423d50e9785e6c97b566059abcb51e7d6e3d99f0 (patch) | |
| tree | 7d671066170ba6632dc38aa11cfe98ae5514dcb1 /MediaBrowser.Providers | |
| parent | 534716d9c90fd0691dcbe3ec5a3fdf8ac265cbb1 (diff) | |
| parent | 73fac50e57982ac46aea2b487e9906826c3dc3b2 (diff) | |
Merge pull request #1838 from Unhelpful/media-attachments
Add support for embedded attachments in media files
Diffstat (limited to 'MediaBrowser.Providers')
| -rw-r--r-- | MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs index d2abd2a639..2b178d4d4e 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs @@ -158,11 +158,13 @@ namespace MediaBrowser.Providers.MediaInfo MetadataRefreshOptions options) { List<MediaStream> mediaStreams; + IReadOnlyList<MediaAttachment> mediaAttachments; List<ChapterInfo> chapters; if (mediaInfo != null) { mediaStreams = mediaInfo.MediaStreams; + mediaAttachments = mediaInfo.MediaAttachments; video.TotalBitrate = mediaInfo.Bitrate; //video.FormatName = (mediaInfo.Container ?? string.Empty) @@ -198,6 +200,7 @@ namespace MediaBrowser.Providers.MediaInfo else { mediaStreams = new List<MediaStream>(); + mediaAttachments = Array.Empty<MediaAttachment>(); chapters = new List<ChapterInfo>(); } @@ -210,19 +213,20 @@ namespace MediaBrowser.Providers.MediaInfo FetchEmbeddedInfo(video, mediaInfo, options, libraryOptions); FetchPeople(video, mediaInfo, options); video.Timestamp = mediaInfo.Timestamp; - video.Video3DFormat = video.Video3DFormat ?? mediaInfo.Video3DFormat; + video.Video3DFormat ??= mediaInfo.Video3DFormat; } var videoStream = mediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Video); - video.Height = videoStream == null ? 0 : videoStream.Height ?? 0; - video.Width = videoStream == null ? 0 : videoStream.Width ?? 0; + video.Height = videoStream?.Height ?? 0; + video.Width = videoStream?.Width ?? 0; video.DefaultVideoStreamIndex = videoStream == null ? (int?)null : videoStream.Index; video.HasSubtitles = mediaStreams.Any(i => i.Type == MediaStreamType.Subtitle); _itemRepo.SaveMediaStreams(video.Id, mediaStreams, cancellationToken); + _itemRepo.SaveMediaAttachments(video.Id, mediaAttachments, cancellationToken); if (options.MetadataRefreshMode == MetadataRefreshMode.FullRefresh || options.MetadataRefreshMode == MetadataRefreshMode.Default) |
