From 1513c76a3e0b8f84def98df3fe99432370076497 Mon Sep 17 00:00:00 2001 From: Andrew Mahone Date: Mon, 7 Oct 2019 07:53:28 -0400 Subject: [PATCH] Support MediaAttachment retrieval in MediaSourceManager. --- .../Library/MediaSourceManager.cs | 26 +++++++++++++++++++ .../Library/IMediaSourceManager.cs | 19 ++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/Emby.Server.Implementations/Library/MediaSourceManager.cs b/Emby.Server.Implementations/Library/MediaSourceManager.cs index d83e1fc02..e069ebd17 100644 --- a/Emby.Server.Implementations/Library/MediaSourceManager.cs +++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs @@ -128,6 +128,32 @@ namespace Emby.Server.Implementations.Library return streams; } + public List GetMediaAttachments(MediaAttachmentQuery query) + { + var list = _itemRepo.GetMediaAttachments(query); + return list; + } + + public List GetMediaAttachments(string mediaSourceId) + { + var list = GetMediaAttachments(new MediaAttachmentQuery + { + ItemId = new Guid(mediaSourceId) + }); + + return list; + } + + public List GetMediaAttachments(Guid itemId) + { + var list = GetMediaAttachments(new MediaAttachmentQuery + { + ItemId = itemId + }); + + return list; + } + public async Task> GetPlayackMediaSources(BaseItem item, User user, bool allowMediaProbe, bool enablePathSubstitution, CancellationToken cancellationToken) { var mediaSources = GetStaticMediaSources(item, enablePathSubstitution, user); diff --git a/MediaBrowser.Controller/Library/IMediaSourceManager.cs b/MediaBrowser.Controller/Library/IMediaSourceManager.cs index fbae4edb0..961028b04 100644 --- a/MediaBrowser.Controller/Library/IMediaSourceManager.cs +++ b/MediaBrowser.Controller/Library/IMediaSourceManager.cs @@ -38,6 +38,25 @@ namespace MediaBrowser.Controller.Library /// IEnumerable<MediaStream>. List GetMediaStreams(MediaStreamQuery query); + /// + /// Gets the media attachments. + /// + /// The item identifier. + /// IEnumerable<MediaAttachment>. + List GetMediaAttachments(Guid itemId); + /// + /// Gets the media attachments. + /// + /// The The media source identifier. + /// IEnumerable<MediaAttachment>. + List GetMediaAttachments(string mediaSourceId); + /// + /// Gets the media attachments. + /// + /// The query. + /// IEnumerable<MediaAttachment>. + List GetMediaAttachments(MediaAttachmentQuery query); + /// /// Gets the playack media sources. ///