jellyfin/MediaBrowser.Api/HttpHandlers/ServerConfigurationHandler.cs
LukePulverenti Luke Pulverenti luke pulverenti 4752d12aaa Switched date operations to utc
2012-09-04 15:23:15 -04:00

31 lines
909 B
C#

using System;
using System.IO;
using System.Threading.Tasks;
using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Controller;
using MediaBrowser.Model.Configuration;
namespace MediaBrowser.Api.HttpHandlers
{
class ServerConfigurationHandler : BaseSerializationHandler<ServerConfiguration>
{
protected override Task<ServerConfiguration> GetObjectToSerialize()
{
return Task.FromResult<ServerConfiguration>(Kernel.Instance.Configuration);
}
public override TimeSpan CacheDuration
{
get
{
return TimeSpan.FromDays(7);
}
}
protected override Task<DateTime?> GetLastDateModified()
{
return Task.FromResult<DateTime?>(File.GetLastWriteTimeUtc(Kernel.Instance.ApplicationPaths.SystemConfigurationFilePath));
}
}
}