mirror of
https://github.com/dirtydishes/dreamio.git
synced 2026-06-06 21:38:15 +00:00
let mkv streams use the range cache
This commit is contained in:
parent
b16857a9fa
commit
4d0e675aa3
5 changed files with 266 additions and 16 deletions
|
|
@ -272,10 +272,6 @@ final class HTTPRangeRemoteFetcher {
|
|||
guard !url.path.lowercased().hasSuffix(".m3u8") else {
|
||||
return HTTPRangeProbeResult(isCacheable: false, contentLength: nil, fallbackReason: "hls-playlist")
|
||||
}
|
||||
guard !Self.shouldBypassCache(for: url) else {
|
||||
return HTTPRangeProbeResult(isCacheable: false, contentLength: nil, fallbackReason: "tail-index-container")
|
||||
}
|
||||
|
||||
if let head = try? await response(for: request(method: "HEAD")),
|
||||
(200..<400).contains(head.statusCode) {
|
||||
let acceptsRanges = header("Accept-Ranges", in: head)?.lowercased().contains("bytes") == true
|
||||
|
|
@ -334,10 +330,6 @@ final class HTTPRangeRemoteFetcher {
|
|||
response.value(forHTTPHeaderField: name)
|
||||
}
|
||||
|
||||
private static func shouldBypassCache(for url: URL) -> Bool {
|
||||
let extensionName = url.pathExtension.lowercased()
|
||||
return ["mkv", "mk3d", "mka", "mks", "webm"].contains(extensionName)
|
||||
}
|
||||
}
|
||||
|
||||
enum HTTPRangeCacheError: Error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue