Skip to content

Commit

Permalink
Experiment with streaming option
Browse files Browse the repository at this point in the history
  • Loading branch information
da3dsoul committed Nov 21, 2023
1 parent 9c5c921 commit f63578f
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ public class ShokoServiceImplementationStream : Controller, IShokoServerStream,
public object StreamVideo(int videolocalid, int? userId, bool? autowatch, string fakename)
{
var r = ResolveVideoLocal(videolocalid, userId, autowatch);
if (r.Status != HttpStatusCode.OK && r.Status != HttpStatusCode.PartialContent)
{
return StatusCode((int)r.Status, r.StatusDescription);
}
if (r.Status != HttpStatusCode.OK && r.Status != HttpStatusCode.PartialContent) return StatusCode((int)r.Status, r.StatusDescription);
if (!string.IsNullOrEmpty(fakename)) return StreamFromIFile(r, autowatch);

return StreamFromIFile(r, autowatch);
var subs = r.VideoLocal.Media.TextStreams.Where(a => a.External).ToList();
if (!subs.Any()) return StatusCode(404);

return "<table>" + string.Join(string.Empty, subs.Select(a => "<tr><td><a href=\"" + a.Filename + "\"/></td></tr>")) + "</table>";
}

[HttpGet("Filename/{base64filename}/{userId?}/{autowatch?}/{fakename?}")]
Expand Down

0 comments on commit f63578f

Please sign in to comment.