Browse Source

cache bust xmltv images (#1771)

pull/1772/head
Jason Dove 2 years ago committed by GitHub
parent
commit
b5d679212d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 6
      ErsatzTV.Application/Channels/Queries/GetChannelGuideHandler.cs
  3. 2
      ErsatzTV.Infrastructure/Plex/Models/PlexMediaContainerResponse.cs

4
CHANGELOG.md

@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Items in these libraries will have tag metadata added from folders just like local Other Video libraries
- Thanks @raknam for adding this feature!
### Fixed
- Add basic cache busting to XMLTV image URLs
- This should help with clients not showing correct channel logos or posters
### Changed
- Remove some unnecessary API calls related to media server scanning and paging

6
ErsatzTV.Application/Channels/Queries/GetChannelGuideHandler.cs

@ -36,10 +36,12 @@ public class GetChannelGuideHandler : IRequestHandler<GetChannelGuide, Either<Ba @@ -36,10 +36,12 @@ public class GetChannelGuideHandler : IRequestHandler<GetChannelGuide, Either<Ba
return BaseError.New($"Required file {channelsFile} is missing");
}
string accessTokenUri = string.Empty;
long mtime = File.GetLastWriteTime(channelsFile).Ticks;
var accessTokenUri = $"?v={mtime}";
if (!string.IsNullOrWhiteSpace(request.AccessToken))
{
accessTokenUri = $"?access_token={request.AccessToken}";
accessTokenUri += $"&access_token={request.AccessToken}";
}
string channelsFragment = await File.ReadAllTextAsync(channelsFile, Encoding.UTF8, cancellationToken);

2
ErsatzTV.Infrastructure/Plex/Models/PlexMediaContainerResponse.cs

@ -9,7 +9,7 @@ public class PlexMediaContainerResponse<T> @@ -9,7 +9,7 @@ public class PlexMediaContainerResponse<T>
public class PlexMediaContainerDirectoryContent<T>
{
public List<T> Directory { get; set; }
public List<T> Directory { get; set; } = [];
}
public class PlexMediaContainerMetadataContent<T>

Loading…
Cancel
Save