StaticResultOptions.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Threading.Tasks;
  5. namespace MediaBrowser.Controller.Net
  6. {
  7. public class StaticResultOptions
  8. {
  9. public string ContentType { get; set; }
  10. public TimeSpan? CacheDuration { get; set; }
  11. public DateTime? DateLastModified { get; set; }
  12. public Guid CacheKey { get; set; }
  13. public Func<Task<Stream>> ContentFactory { get; set; }
  14. public bool IsHeadRequest { get; set; }
  15. public IDictionary<string, string> ResponseHeaders { get; set; }
  16. public bool Throttle { get; set; }
  17. public long ThrottleLimit { get; set; }
  18. public long MinThrottlePosition { get; set; }
  19. public StaticResultOptions()
  20. {
  21. ResponseHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
  22. }
  23. }
  24. public class StaticFileResultOptions : StaticResultOptions
  25. {
  26. public string Path { get; set; }
  27. public FileShare FileShare { get; set; }
  28. public StaticFileResultOptions()
  29. {
  30. FileShare = FileShare.Read;
  31. }
  32. }
  33. }