diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-09-17 21:51:22 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-09-17 21:51:22 -0400 |
| commit | 2acd1665c9b2d6fb087e131805f881d2f596f5c4 (patch) | |
| tree | 4fff6b1221dc990f0a5f5e2af55f5de223587c21 /MediaBrowser.Api | |
| parent | 8a4f86aefe3f2770f794b063b29e492c896e80fc (diff) | |
update series timers
Diffstat (limited to 'MediaBrowser.Api')
| -rw-r--r-- | MediaBrowser.Api/Playback/MediaInfoService.cs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/MediaBrowser.Api/Playback/MediaInfoService.cs b/MediaBrowser.Api/Playback/MediaInfoService.cs index 0b7b501340..2ab2d11f60 100644 --- a/MediaBrowser.Api/Playback/MediaInfoService.cs +++ b/MediaBrowser.Api/Playback/MediaInfoService.cs @@ -57,7 +57,7 @@ namespace MediaBrowser.Api.Playback Size = 102400; } } - + [Authenticated] public class MediaInfoService : BaseApiService { @@ -289,7 +289,7 @@ namespace MediaBrowser.Api.Playback if (mediaSource.SupportsDirectStream) { options.MaxBitrate = GetMaxBitrate(maxBitrate); - + // The MediaSource supports direct stream, now test to see if the client supports it var streamInfo = string.Equals(item.MediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase) ? streamBuilder.BuildAudioItem(options) : @@ -309,7 +309,7 @@ namespace MediaBrowser.Api.Playback if (mediaSource.SupportsTranscoding) { options.MaxBitrate = GetMaxBitrate(maxBitrate); - + // The MediaSource supports direct stream, now test to see if the client supports it var streamInfo = string.Equals(item.MediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase) ? streamBuilder.BuildAudioItem(options) : @@ -336,9 +336,15 @@ namespace MediaBrowser.Api.Playback var maxBitrate = clientMaxBitrate; var remoteClientMaxBitrate = _config.Configuration.RemoteClientBitrateLimit; - if (remoteClientMaxBitrate > 0 && !_networkManager.IsInLocalNetwork(Request.RemoteIp)) + if (remoteClientMaxBitrate > 0) { - maxBitrate = Math.Min(maxBitrate ?? remoteClientMaxBitrate, remoteClientMaxBitrate); + var isInLocalNetwork = _networkManager.IsInLocalNetwork(Request.RemoteIp); + + Logger.Info("RemoteClientBitrateLimit: {0}, RemoteIp: {1}, IsInLocalNetwork: {2}", remoteClientMaxBitrate, Request.RemoteIp, isInLocalNetwork); + if (!isInLocalNetwork) + { + maxBitrate = Math.Min(maxBitrate ?? remoteClientMaxBitrate, remoteClientMaxBitrate); + } } return maxBitrate; |
