Merge pull request #1416 from MediaBrowser/beta

Beta
This commit is contained in:
Luke 2016-01-20 15:22:30 -05:00
commit e272c40a52
3 changed files with 2 additions and 27 deletions

View File

@ -58,21 +58,6 @@ namespace MediaBrowser.Api
return ResultFactory.GetOptimizedResult(Request, result);
}
/// <summary>
/// To the optimized result using cache.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="cacheKey">The cache key.</param>
/// <param name="lastDateModified">The last date modified.</param>
/// <param name="cacheDuration">Duration of the cache.</param>
/// <param name="factoryFn">The factory function.</param>
/// <returns>System.Object.</returns>
protected object ToOptimizedResultUsingCache<T>(Guid cacheKey, DateTime? lastDateModified, TimeSpan? cacheDuration, Func<T> factoryFn)
where T : class
{
return ResultFactory.GetOptimizedResultUsingCache(Request, cacheKey, lastDateModified, cacheDuration, factoryFn);
}
protected void AssertCanUpdateUser(IUserManager userManager, string userId)
{
var auth = AuthorizationContext.GetAuthorizationInfo(Request);

View File

@ -105,13 +105,7 @@ namespace MediaBrowser.Api
/// <returns>System.Object.</returns>
public object Get(GetConfiguration request)
{
var configPath = _configurationManager.ApplicationPaths.SystemConfigurationFilePath;
var dateModified = _fileSystem.GetLastWriteTimeUtc(configPath);
var cacheKey = (configPath + dateModified.Ticks).GetMD5();
return ToOptimizedResultUsingCache(cacheKey, dateModified, null, () => _configurationManager.Configuration);
return ToOptimizedResult(_configurationManager.Configuration);
}
public object Get(GetNamedConfiguration request)

View File

@ -250,11 +250,7 @@ namespace MediaBrowser.Api
var guid = new Guid(request.Id);
var plugin = _appHost.Plugins.First(p => p.Id == guid);
var dateModified = plugin.ConfigurationDateLastModified;
var cacheKey = (plugin.Version.ToString() + dateModified.Ticks).GetMD5();
return ToOptimizedResultUsingCache(cacheKey, dateModified, null, () => plugin.Configuration);
return ToOptimizedResult(plugin.Configuration);
}
/// <summary>