diff options
| author | Luke <luke.pulverenti@gmail.com> | 2015-03-31 15:41:12 -0400 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2015-03-31 15:41:12 -0400 |
| commit | be74de0236a3544959722b3a8ff9c9ca26c73d13 (patch) | |
| tree | 292d0abda239cd3966840b7e93568580209bf189 /MediaBrowser.Controller/Channels | |
| parent | aa079120059699f4778d80f55e68883d75d26b3a (diff) | |
| parent | 2626b6f3729097e083f381936738d17335f48f1c (diff) | |
Merge pull request #1058 from MediaBrowser/dev
3.0.5569.0
Diffstat (limited to 'MediaBrowser.Controller/Channels')
4 files changed, 30 insertions, 14 deletions
diff --git a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs b/MediaBrowser.Controller/Channels/ChannelAudioItem.cs index 91b2407bee..8d90246765 100644 --- a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs +++ b/MediaBrowser.Controller/Channels/ChannelAudioItem.cs @@ -75,17 +75,23 @@ namespace MediaBrowser.Controller.Channels public override IEnumerable<MediaSourceInfo> GetMediaSources(bool enablePathSubstitution) { - var list = base.GetMediaSources(enablePathSubstitution).ToList(); - - var sources = ChannelManager.GetChannelItemMediaSources(Id.ToString("N"), false, CancellationToken.None) - .Result.ToList(); + var sources = ChannelManager.GetStaticMediaSources(this, false, CancellationToken.None) + .Result.ToList(); if (sources.Count > 0) { return sources; } - list.InsertRange(0, sources); + var list = base.GetMediaSources(enablePathSubstitution).ToList(); + + foreach (var mediaSource in list) + { + if (string.IsNullOrWhiteSpace(mediaSource.Path)) + { + mediaSource.Type = MediaSourceType.Placeholder; + } + } return list; } diff --git a/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs b/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs index 0c2e30923c..1672b75fac 100644 --- a/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs +++ b/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs @@ -38,6 +38,7 @@ namespace MediaBrowser.Controller.Channels public string Id { get; set; } public bool ReadAtNativeFramerate { get; set; } + public bool SupportsDirectPlay { get; set; } public ChannelMediaInfo() { @@ -45,6 +46,7 @@ namespace MediaBrowser.Controller.Channels // This is most common Protocol = MediaProtocol.Http; + SupportsDirectPlay = true; } public MediaSourceInfo ToMediaSource() @@ -62,7 +64,9 @@ namespace MediaBrowser.Controller.Channels RunTimeTicks = RunTimeTicks, Name = id, Id = id, - ReadAtNativeFramerate = ReadAtNativeFramerate + ReadAtNativeFramerate = ReadAtNativeFramerate, + SupportsDirectStream = Protocol == MediaProtocol.File || Protocol == MediaProtocol.Http, + SupportsDirectPlay = SupportsDirectPlay }; var bitrate = (AudioBitrate ?? 0) + (VideoBitrate ?? 0); diff --git a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs index d7d4483cd1..8eec2021b5 100644 --- a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs +++ b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs @@ -90,17 +90,23 @@ namespace MediaBrowser.Controller.Channels public override IEnumerable<MediaSourceInfo> GetMediaSources(bool enablePathSubstitution) { - var list = base.GetMediaSources(enablePathSubstitution).ToList(); - - var sources = ChannelManager.GetChannelItemMediaSources(Id.ToString("N"), false, CancellationToken.None) - .Result.ToList(); + var sources = ChannelManager.GetStaticMediaSources(this, false, CancellationToken.None) + .Result.ToList(); if (sources.Count > 0) { return sources; } - list.InsertRange(0, sources); + var list = base.GetMediaSources(enablePathSubstitution).ToList(); + + foreach (var mediaSource in list) + { + if (string.IsNullOrWhiteSpace(mediaSource.Path)) + { + mediaSource.Type = MediaSourceType.Placeholder; + } + } return list; } diff --git a/MediaBrowser.Controller/Channels/IChannelManager.cs b/MediaBrowser.Controller/Channels/IChannelManager.cs index 05015da37d..f5c4ab3733 100644 --- a/MediaBrowser.Controller/Channels/IChannelManager.cs +++ b/MediaBrowser.Controller/Channels/IChannelManager.cs @@ -112,11 +112,11 @@ namespace MediaBrowser.Controller.Channels /// <summary> /// Gets the channel item media sources. /// </summary> - /// <param name="id">The identifier.</param> - /// <param name="includeDynamicSources">if set to <c>true</c> [include dynamic sources].</param> + /// <param name="item">The item.</param> + /// <param name="includeCachedVersions">if set to <c>true</c> [include cached versions].</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{IEnumerable{MediaSourceInfo}}.</returns> - Task<IEnumerable<MediaSourceInfo>> GetChannelItemMediaSources(string id, bool includeDynamicSources, CancellationToken cancellationToken); + Task<IEnumerable<MediaSourceInfo>> GetStaticMediaSources(IChannelMediaItem item, bool includeCachedVersions, CancellationToken cancellationToken); /// <summary> /// Gets the channel folder. |
