The Free Software Media System - Server Backend & API
added dlna headers for images
Luke Pulverenti9254c37d52af
diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.csindex bea1ed5057..5fba539fe5 100644--- a/MediaBrowser.Api/BaseApiService.cs+++ b/MediaBrowser.Api/BaseApiService.cs@@ -77,7 +77,7 @@ namespace MediaBrowser.Api{return ToOptimizedResult(result);}-+/// <summary>/// To the cached result./// </summary>@@ -87,12 +87,13 @@ namespace MediaBrowser.Api/// <param name="cacheDuration">Duration of the cache.</param>/// <param name="factoryFn">The factory fn.</param>/// <param name="contentType">Type of the content.</param>+ /// <param name="responseHeaders">The response headers.</param>/// <returns>System.Object.</returns>/// <exception cref="System.ArgumentNullException">cacheKey</exception>- protected object ToCachedResult<T>(Guid cacheKey, DateTime lastDateModified, TimeSpan? cacheDuration, Func<T> factoryFn, string contentType)+ protected object ToCachedResult<T>(Guid cacheKey, DateTime lastDateModified, TimeSpan? cacheDuration, Func<T> factoryFn, string contentType, IDictionary<string,string> responseHeaders = null)where T : class{- return ResultFactory.GetCachedResult(Request, cacheKey, lastDateModified, cacheDuration, factoryFn, contentType);+ return ResultFactory.GetCachedResult(Request, cacheKey, lastDateModified, cacheDuration, factoryFn, contentType, responseHeaders);}/// <summary>diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.csindex 8dfecceec7..daa52f5a01 100644--- a/MediaBrowser.Api/Images/ImageService.cs+++ b/MediaBrowser.Api/Images/ImageService.cs@@ -707,6 +707,11 @@ namespace MediaBrowser.Api.Imagesvar currentItem = item;var currentRequest = request;+ var responseHeaders = new Dictionary<string, string>();++ responseHeaders.Add("transferMode.dlna.org", "Interactive");+ responseHeaders.Add("realTimeInfo.dlna.org", "DLNA.ORG_TLAG=*");+return ToCachedResult(cacheGuid, originalFileImageDateModified, cacheDuration, () => new ImageWriter{Item = currentItem,@@ -716,7 +721,7 @@ namespace MediaBrowser.Api.ImagesOriginalImagePath = imageInfo.Path,ImageProcessor = _imageProcessor- }, contentType);+ }, contentType, responseHeaders);}private string GetMimeType(ImageOutputFormat format, string path)