コード例 #1
0
        public async Task UpdateTimerAsync(TimerInfo info, System.Threading.CancellationToken cancellationToken)
        {
            _logger.Info("[VDR LiveTV] UpdateTimerAsync ...");
            _logger.Info(info.ToJson());

            await VdrApiClient.UpdateTimer(info);
        }
コード例 #2
0
        public async Task <IEnumerable <ChannelInfo> > GetChannelsAsync(System.Threading.CancellationToken cancellationToken)
        {
            _logger.Info("[VDR LiveTV] GetChannelsAsync ...");

            var channels = await VdrApiClient.GetChannelsAsync(_logger);

            return(channels);
        }
コード例 #3
0
        public async Task <IEnumerable <TimerInfo> > GetTimersAsync(System.Threading.CancellationToken cancellationToken)
        {
            _logger.Info("[VDR LiveTV] GetTimersAsync ...");

            var timers = await VdrApiClient.GetTimersAsync();

            return(timers);
        }
コード例 #4
0
        public async Task <IEnumerable <RecordingInfo> > GetRecordingsAsync(System.Threading.CancellationToken cancellationToken)
        {
            _logger.Info("[VDR LiveTV] GetRecordingsAsync ...");

            var recordings = await VdrApiClient.GetRecordingsAsync();

            return(recordings);
        }
コード例 #5
0
        public async Task <IEnumerable <ProgramInfo> > GetProgramsAsync(string channelId, DateTime startDateUtc, DateTime endDateUtc, System.Threading.CancellationToken cancellationToken)
        {
            _logger.Info("[VDR LiveTV] GetProgramsAsync | {0} | {1} - {2} ...", channelId, startDateUtc, endDateUtc);

            var events = await VdrApiClient.GetEventAsync(channelId, startDateUtc, endDateUtc);

            return(events);
        }
コード例 #6
0
        public async Task <IEnumerable <ProgramInfo> > GetProgramsAsync(string channelId, DateTime startDateUtc, DateTime endDateUtc, System.Threading.CancellationToken cancellationToken)
        {
            _logger.Info("[VDR LiveTV] GetProgramsAsync | {0} | {1} - {2} ...", channelId, startDateUtc.ToLocalTime(), endDateUtc.ToLocalTime());
            try
            {
                var events = await VdrApiClient.GetEventAsync(channelId, startDateUtc.ToLocalTime(), endDateUtc.ToLocalTime(), _logger);

                return(events);
            }
            catch (Exception ex)
            {
                _logger.Info("[VDR LiveTV] GetProgramsAsync - no events | {0} | {1} - {2} | {3}...", channelId, startDateUtc.ToLocalTime(), endDateUtc.ToLocalTime(), ex.Message);
                return(null);
            }
        }
コード例 #7
0
        public async Task <MediaBrowser.Controller.Drawing.ImageStream> GetProgramImageAsync(string programId, string channelId, System.Threading.CancellationToken cancellationToken)
        {
            _logger.Info("[VDR LiveTV] GetProgramImageAsync | {0} | {1} ...", programId, channelId);

            try
            {
                byte[] imgData = await VdrApiClient.GetEventImageAsync(int.Parse(programId), 0);

                _logger.Info("[VDR LiveTV] GetProgramImageAsync {0} bytes reveived.", imgData.Length);

                return(new MediaBrowser.Controller.Drawing.ImageStream
                {
                    Format = MediaBrowser.Model.Drawing.ImageFormat.Jpg,
                    Stream = new MemoryStream(imgData)
                });
            }
            catch (Exception ex)
            {
                _logger.Info("[VDR LiveTV] GetProgramImageAsync error: ", ex.Message);
                return(null);
            }
        }
コード例 #8
0
        public async Task CancelTimerAsync(string timerId, System.Threading.CancellationToken cancellationToken)
        {
            _logger.Info("[VDR LiveTV] CancelTimerAsync ...");

            await VdrApiClient.CancelTimer(timerId);
        }
コード例 #9
0
        public async Task DeleteRecordingAsync(string recordingId, System.Threading.CancellationToken cancellationToken)
        {
            _logger.Info("[VDR LiveTV] DeleteRecordingAsync ...");

            await VdrApiClient.DeleteRecording(recordingId);
        }