mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 11:57:55 +02:00
30 lines
909 B
C#
30 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));
|
|
}
|
|
}
|
|
}
|