Ejemplo n.º 1
0
        public TvDbSearch(ITvDbClient client, IMemoryCache cache, TvDbOptions options)
        {
            _client    = client ?? throw new ArgumentNullException(nameof(client));
            _cache     = cache ?? throw new ArgumentNullException(nameof(cache));
            _options   = options ?? throw new ArgumentNullException(nameof(options));
            _semaphore = new SemaphoreSlim(1, 1);

            AuthenticateAsync().GetAwaiter().GetResult();
        }
Ejemplo n.º 2
0
 public Fetcher(
     TrackTvDbContext context,
     ITvDbClient client,
     IEpisodeFetcher episodeFetcher,
     IActorFetcher actorFetcher,
     IGenreFetcher genreFetcher,
     IShowFetcher showFetcher,
     IShowsRepository showsRepository,
     IEpisodeRepository episodeRepository)
 {
     this.Context = context;
     this.Client = client;
     this.EpisodeFetcher = episodeFetcher;
     this.ActorFetcher = actorFetcher;
     this.GenreFetcher = genreFetcher;
     this.ShowFetcher = showFetcher;
     this.ShowsRepository = showsRepository;
     this.EpisodeRepository = episodeRepository;
 }
        public void Setup()
        {
            this.tvDbClient  = Substitute.For <ITvDbClient>();
            this.aniDbClient = Substitute.For <IAniDbClient>();

            this.tvDbEpisodeA  = TestData.TvDbTestData.Episode(12, 48, 2);
            this.tvDbEpisodeB  = TestData.TvDbTestData.Episode(45, 7, 2);
            this.aniDbEpisodeA = new AniDbEpisodeData
            {
                RawEpisodeNumber = new EpisodeNumberData
                {
                    RawNumber = "44",
                    RawType   = 1
                }
            };
            this.aniDbEpisodeB = new AniDbEpisodeData
            {
                RawEpisodeNumber = new EpisodeNumberData
                {
                    RawNumber = "23",
                    RawType   = 1
                }
            };

            this.tvDbClient.GetEpisodesAsync(123)
            .Returns(Option <List <TvDbEpisodeData> > .Some(new List <TvDbEpisodeData> {
                this.tvDbEpisodeA, this.tvDbEpisodeB
            }));
            this.aniDbClient.GetSeriesAsync(77)
            .Returns(Option <AniDbSeriesData> .Some(new AniDbSeriesData
            {
                Episodes = new[] { this.aniDbEpisodeA, this.aniDbEpisodeB }
            }));

            this.mapper = new GroupMappingEpisodeMapper(this.tvDbClient, this.aniDbClient, new ConsoleLogManager());
        }
 public GroupMappingEpisodeMapper(ITvDbClient tvDbClient, IAniDbClient aniDbClient, ILogManager logManager)
 {
     this.log         = logManager.GetLogger(nameof(GroupMappingEpisodeMapper));
     this.tvDbClient  = tvDbClient;
     this.aniDbClient = aniDbClient;
 }
 public DefaultSeasonEpisodeMapper(ITvDbClient tvDbClient, ILogManager logManager)
 {
     this.log        = logManager.GetLogger(nameof(DefaultSeasonEpisodeMapper));
     this.tvDbClient = tvDbClient;
 }
Ejemplo n.º 6
0
 public Copier(Arguments arguments, ITvDbClient client, Options options)
 {
     this.arguments = arguments;
     this.client    = client;
     this.options   = options;
 }
 public TvDbEpisodeFromEmbyData(ISources sources, ITvDbClient tvDbClient, ITitleNormaliser titleNormaliser)
 {
     this.sources         = sources;
     this.tvDbClient      = tvDbClient;
     this.titleNormaliser = titleNormaliser;
 }
Ejemplo n.º 8
0
 public TVProcessor(string apiKey)
 {
     this.tvdb   = new TvDbClient();
     this.apiKey = apiKey;
 }
Ejemplo n.º 9
0
 public TvDbSeriesFromEmbyData(ITvDbClient tvDbClient, ISources sources)
 {
     this.tvDbClient = tvDbClient;
     this.sources    = sources;
 }
 public TvDbSource(ITvDbClient tvDbClient, IEnumerable <IEmbySourceDataLoader> embySourceDataLoaders)
 {
     _tvDbClient            = tvDbClient;
     _embySourceDataLoaders = embySourceDataLoaders;
 }
Ejemplo n.º 11
0
 static TvDBApiHelper()
 {
     client         = new TvDbClient();
     client.BaseUrl = "https://api-beta.thetvdb.com";
 }
Ejemplo n.º 12
0
 public TvDbSeriesFromEmbyData(ITvDbClient tvDbClient, ISources sources)
 {
     _tvDbClient = tvDbClient;
     _sources    = sources;
 }