コード例 #1
0
        public async Task <Series> GetSeriesAsync(string tvdbId, int seriesNumber, int episodeNumber, bool forceRefresh)
        {
            var foundSeries = await _seriesCache.GetOrAddAsync(tvdbId, async s =>
            {
                var series = await _tvdbConnection.GetSeriesAsync(s);
                return((series == null || series.GetEpisode(seriesNumber, episodeNumber) == null) ? null : series);
            }, forceRefresh);

            if (foundSeries == null || foundSeries.GetEpisode(seriesNumber, episodeNumber) == null)
            {
                _seriesCache.MarkAsFailed(tvdbId);
                return(null);
            }

            return(foundSeries);
        }