jellyfin/MediaBrowser.Controller/Net/StaticResultOptions.cs

44 lines
1.1 KiB
C#
Raw Normal View History

2014-08-30 07:26:29 -07:00
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
2016-10-25 12:02:04 -07:00
using MediaBrowser.Common.IO;
using MediaBrowser.Model.IO;
2014-08-30 07:26:29 -07:00
namespace MediaBrowser.Controller.Net
{
public class StaticResultOptions
{
public string ContentType { get; set; }
public TimeSpan? CacheDuration { get; set; }
public DateTime? DateLastModified { get; set; }
public Guid CacheKey { get; set; }
public Func<Task<Stream>> ContentFactory { get; set; }
public bool IsHeadRequest { get; set; }
public IDictionary<string, string> ResponseHeaders { get; set; }
2014-09-02 19:30:24 -07:00
public Action OnComplete { get; set; }
2015-10-02 11:30:27 -07:00
public Action OnError { get; set; }
2014-08-30 07:26:29 -07:00
public StaticResultOptions()
{
ResponseHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
}
public class StaticFileResultOptions : StaticResultOptions
{
public string Path { get; set; }
2016-10-25 12:02:04 -07:00
public FileShareMode FileShare { get; set; }
2014-08-30 07:26:29 -07:00
public StaticFileResultOptions()
{
2016-10-25 12:02:04 -07:00
FileShare = FileShareMode.Read;
2014-08-30 07:26:29 -07:00
}
}
}