Browse Source

Add base URL to variant playlists (#2755)

* Add PathBase to variant playlists

* add commented code to help with testing

* update changelog

---------

Co-authored-by: Jason Dove <1695733+jasongdove@users.noreply.github.com>
pull/2756/head
James Dearlove 7 months ago committed by GitHub
parent
commit
5c42609527
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 2
      ErsatzTV/Controllers/IptvController.cs
  3. 12
      ErsatzTV/Startup.cs

1
CHANGELOG.md

@ -73,6 +73,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix multi-part episode grouping logic so that it does NOT require release date metadata for episodes within a single show - Fix multi-part episode grouping logic so that it does NOT require release date metadata for episodes within a single show
- When **Treat Collections As Shows** is enabled (i.e. for crossover episodes) release date metadata is required for proper grouping - When **Treat Collections As Shows** is enabled (i.e. for crossover episodes) release date metadata is required for proper grouping
- Fix *many* cases of duplicate names; enforce case-insensitive unique names at the db schema level - Fix *many* cases of duplicate names; enforce case-insensitive unique names at the db schema level
- Fix playback when using `ETV_BASE_URL` by @JamesDearlove
### Changed ### Changed
- No longer round framerate to nearest integer when normalizing framerate - No longer round framerate to nearest integer when normalizing framerate

2
ErsatzTV/Controllers/IptvController.cs

@ -292,7 +292,7 @@ public class IptvController : StreamingControllerBase
private async Task<string> GetMultiVariantPlaylist(string channelNumber) private async Task<string> GetMultiVariantPlaylist(string channelNumber)
{ {
var variantPlaylist = var variantPlaylist =
$"{Request.Scheme}://{Request.Host}/iptv/session/{channelNumber}/hls.m3u8{AccessTokenQuery()}"; $"{Request.Scheme}://{Request.Host}{Request.PathBase}/iptv/session/{channelNumber}/hls.m3u8{AccessTokenQuery()}";
Option<ChannelStreamingSpecsViewModel> maybeStreamingSpecs = Option<ChannelStreamingSpecsViewModel> maybeStreamingSpecs =
await _mediator.Send(new GetChannelStreamingSpecs(channelNumber)); await _mediator.Send(new GetChannelStreamingSpecs(channelNumber));

12
ErsatzTV/Startup.cs

@ -527,6 +527,18 @@ public class Startup
try try
{ {
app.UsePathBase(baseUrl); app.UsePathBase(baseUrl);
// for testing - make path base required
// app.Use(async (context, next) =>
// {
// if (context.Request.PathBase != baseUrl)
// {
// context.Response.StatusCode = 404;
// return;
// }
//
// await next(context);
// });
} }
catch (Exception ex) catch (Exception ex)
{ {

Loading…
Cancel
Save