update tuner saving

pull/702/head
Luke Pulverenti 9 years ago
parent b1b5d36f12
commit bc41dcbc7e

@ -43,15 +43,17 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts
} }
var result = await GetChannelsInternal(tuner, cancellationToken).ConfigureAwait(false); var result = await GetChannelsInternal(tuner, cancellationToken).ConfigureAwait(false);
var list = result.ToList();
cache = cache ?? new ChannelCache(); if (!string.IsNullOrWhiteSpace(key))
{
cache.Date = DateTime.UtcNow; cache = cache ?? new ChannelCache();
cache.Channels = result.ToList(); cache.Date = DateTime.UtcNow;
cache.Channels = list;
_channelCache.AddOrUpdate(key, cache, (k, v) => cache); _channelCache.AddOrUpdate(key, cache, (k, v) => cache);
}
return cache.Channels.ToList(); return list;
} }
private List<TunerHostInfo> GetTunerHosts() private List<TunerHostInfo> GetTunerHosts()

Loading…
Cancel
Save