From 44a4e662ac0e2b067266011c686ce79bbef5e93c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 16 Mar 2017 13:21:24 -0400 Subject: update hdhomerun model info caching --- .../LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs index d9c0807de..02a6bf85d 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs @@ -131,7 +131,10 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun DiscoverResponse response; if (_modelCache.TryGetValue(info.Url, out response)) { - return response; + if ((DateTime.UtcNow - response.DateQueried).TotalHours <= 12) + { + return response; + } } } @@ -141,8 +144,6 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun { Url = string.Format("{0}/discover.json", GetApiUrl(info, false)), CancellationToken = cancellationToken, - CacheLength = TimeSpan.FromDays(1), - CacheMode = CacheMode.Unconditional, TimeoutMs = Convert.ToInt32(TimeSpan.FromSeconds(5).TotalMilliseconds), BufferContent = false @@ -638,6 +639,13 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun public string BaseURL { get; set; } public string LineupURL { get; set; } public int TunerCount { get; set; } + + public DateTime DateQueried { get; set; } + + public DiscoverResponse() + { + DateQueried = DateTime.UtcNow; + } } public async Task> DiscoverDevices(int discoveryDurationMs, CancellationToken cancellationToken) -- cgit v1.2.3