aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/MediaInfoService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/Playback/MediaInfoService.cs')
-rw-r--r--MediaBrowser.Api/Playback/MediaInfoService.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/MediaBrowser.Api/Playback/MediaInfoService.cs b/MediaBrowser.Api/Playback/MediaInfoService.cs
index a2ec747be..fcb8c34f3 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");
}