diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-01-21 15:27:07 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-01-21 15:27:07 -0500 |
| commit | 2ef30a3ba85190adb38ad7b2f360c2018cd0a5ff (patch) | |
| tree | 99bceeee3e86def1c651ad209416202a67db7daa /MediaBrowser.Api | |
| parent | 0bf95da493e91b6713f9b3ec76d6c9659a04ec10 (diff) | |
update program titles
Diffstat (limited to 'MediaBrowser.Api')
| -rw-r--r-- | MediaBrowser.Api/Playback/MediaInfoService.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/MediaBrowser.Api/Playback/MediaInfoService.cs b/MediaBrowser.Api/Playback/MediaInfoService.cs index a2ec747be0..fcb8c34f3e 100644 --- a/MediaBrowser.Api/Playback/MediaInfoService.cs +++ b/MediaBrowser.Api/Playback/MediaInfoService.cs @@ -175,6 +175,15 @@ namespace MediaBrowser.Api.Playback return ToOptimizedResult(info); } + private T Clone<T>(T obj) + { + // Since we're going to be setting properties on MediaSourceInfos that come out of _mediaSourceManager, we should clone it + // Should we move this directly into MediaSourceManager? + + var json = _json.SerializeToString(obj); + return _json.DeserializeFromString<T>(json); + } + private async Task<PlaybackInfoResponse> GetPlaybackInfo(string id, string userId, string[] supportedLiveMediaTypes, string mediaSourceId = null, string liveStreamId = null) { var result = new PlaybackInfoResponse(); @@ -217,6 +226,8 @@ namespace MediaBrowser.Api.Playback } else { + result.MediaSources = Clone(result.MediaSources); + result.PlaySessionId = Guid.NewGuid().ToString("N"); } |
