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 { protected override Task GetObjectToSerialize() { return Task.FromResult(Kernel.Instance.Configuration); } public override TimeSpan CacheDuration { get { return TimeSpan.FromDays(7); } } protected override Task GetLastDateModified() { return Task.FromResult(File.GetLastWriteTimeUtc(Kernel.Instance.ApplicationPaths.SystemConfigurationFilePath)); } } }