StaticResultOptions.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 Func<long, long, long> ThrottleCallback { get; set; }
  20. public Action OnComplete { get; set; }
  21. public StaticResultOptions()
  22. {
  23. ResponseHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
  24. }
  25. }
  26. public class StaticFileResultOptions : StaticResultOptions
  27. {
  28. public string Path { get; set; }
  29. public FileShare FileShare { get; set; }
  30. public StaticFileResultOptions()
  31. {
  32. FileShare = FileShare.Read;
  33. }
  34. }
  35. }