public async Task SetActiveTime(TimeSpan timeFrom, TimeSpan timeTo) { var configuration = await LocalCacheProvider.GetAsync <ITTVConfiguration>(ITTVConfigurationPath) ?? new ITTVConfiguration(); configuration.SetActiveTime(timeFrom, timeTo); await LocalCacheProvider.PutAsync(ITTVConfigurationPath, configuration); await _kinectTvHubHandler.SettingsUpdated(); }
public async Task SetDisplayMessage(string displayMessage) { var configuration = await LocalCacheProvider.GetAsync <ITTVConfiguration>(ITTVConfigurationPath) ?? new ITTVConfiguration(); configuration.SetDisplayMessage(displayMessage); await LocalCacheProvider.PutAsync(ITTVConfigurationPath, configuration); await _kinectTvHubHandler.SettingsUpdated(); }
public async Task <ApiFullScheduleResponse> GetFullSchedule(string group) { var timeUpdated = _settings.CacheUpdateInterval; Func <Task <ApiFullScheduleResponse> > dataSource = () => _mireaApiClient.GetFullScheduleForGroup(group); var schedule = await LocalCacheProvider.GetAsync(LocalCacheHelper.GroupScheduleCacheKey(group), dataSource, timeUpdated); return(schedule); }
public async Task <ApiGroups> GetGroups() { var timeUpdated = _settings.CacheUpdateInterval; Func <Task <ApiGroups> > dataSource = () => _mireaApiClient.GetAllGroups(); var groups = await LocalCacheProvider.GetAsync(LocalCacheHelper.GroupsCacheKey, dataSource, timeUpdated); return(groups); }
public async Task <ApiNewsItem[]> GetNews(TimeSpan?expireDateTime = default) { var timeUpdated = expireDateTime ?? _settings.CacheUpdateInterval; Func <Task <ApiNewsItem[]> > dataSource = () => _mireaApiClient.GetNews(); var news = await LocalCacheProvider.GetAsync(LocalCacheHelper.NewsCacheKey, dataSource, timeUpdated); return(news); }
public async Task <ITTVConfiguration> GetTvConfiguration() => await LocalCacheProvider.GetAsync <ITTVConfiguration>(ITTVConfigurationPath) ?? new ITTVConfiguration();