Exemple #1
0
        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();
        }
Exemple #2
0
        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();
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
 public async Task <ITTVConfiguration> GetTvConfiguration()
 => await LocalCacheProvider.GetAsync <ITTVConfiguration>(ITTVConfigurationPath) ?? new ITTVConfiguration();