mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-25 11:34:43 +01:00
re-organize file streaming
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Model.Net
|
||||
{
|
||||
@@ -13,6 +15,7 @@ namespace MediaBrowser.Model.Net
|
||||
void Bind(IpEndPointInfo endpoint);
|
||||
void Connect(IpEndPointInfo endPoint);
|
||||
void StartAccept(Action<IAcceptSocket> onAccept, Func<bool> isClosed);
|
||||
Task SendFile(string path, byte[] preBuffer, byte[] postBuffer, CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
public class SocketCreateException : Exception
|
||||
|
||||
@@ -8,4 +8,9 @@ namespace MediaBrowser.Model.Services
|
||||
{
|
||||
Task WriteToAsync(Stream responseStream, CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
public interface IFileWriter
|
||||
{
|
||||
Task WriteToAsync(Stream responseStream, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Model.Services
|
||||
{
|
||||
@@ -151,6 +153,7 @@ namespace MediaBrowser.Model.Services
|
||||
|
||||
//Add Metadata to Response
|
||||
Dictionary<string, object> Items { get; }
|
||||
}
|
||||
|
||||
Task TransmitFile(string path, long offset, long count, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user