added dlna headers for images

This commit is contained in:
Luke Pulverenti 2014-02-12 20:52:24 -05:00
parent 8986b30c20
commit 9254c37d52
2 changed files with 10 additions and 4 deletions

View File

@ -87,12 +87,13 @@ namespace MediaBrowser.Api
/// <param name="cacheDuration">Duration of the cache.</param> /// <param name="cacheDuration">Duration of the cache.</param>
/// <param name="factoryFn">The factory fn.</param> /// <param name="factoryFn">The factory fn.</param>
/// <param name="contentType">Type of the content.</param> /// <param name="contentType">Type of the content.</param>
/// <param name="responseHeaders">The response headers.</param>
/// <returns>System.Object.</returns> /// <returns>System.Object.</returns>
/// <exception cref="System.ArgumentNullException">cacheKey</exception> /// <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 where T : class
{ {
return ResultFactory.GetCachedResult(Request, cacheKey, lastDateModified, cacheDuration, factoryFn, contentType); return ResultFactory.GetCachedResult(Request, cacheKey, lastDateModified, cacheDuration, factoryFn, contentType, responseHeaders);
} }
/// <summary> /// <summary>

View File

@ -707,6 +707,11 @@ namespace MediaBrowser.Api.Images
var currentItem = item; var currentItem = item;
var currentRequest = request; 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 return ToCachedResult(cacheGuid, originalFileImageDateModified, cacheDuration, () => new ImageWriter
{ {
Item = currentItem, Item = currentItem,
@ -716,7 +721,7 @@ namespace MediaBrowser.Api.Images
OriginalImagePath = imageInfo.Path, OriginalImagePath = imageInfo.Path,
ImageProcessor = _imageProcessor ImageProcessor = _imageProcessor
}, contentType); }, contentType, responseHeaders);
} }
private string GetMimeType(ImageOutputFormat format, string path) private string GetMimeType(ImageOutputFormat format, string path)