Ejemplo n.º 1
0
 public ComicMailBuilder(
     DateTime now,
     IConfigurationSource configurationSource,
     IComicFetcher comicFetcher,
     ILogger log)
 {
     this.now = now;
     this.configurationSource = configurationSource;
     this.comicFetcher        = comicFetcher;
     this.log          = log;
     this.comicFactory = new ComicFactory();
 }
Ejemplo n.º 2
0
 private ComicLocation GetComicLocation(Episode episode)
 {
     this.log.Info($"Getting image URL for {episode}…");
     try
     {
         var comic = ComicFactory.GetComic(episode.ComicName, this.comicFetcher);
         return(comic.GetLocation(episode.Date));
     }
     catch (Exception e)
     {
         this.log.Error($"Caught error getting image URL for {episode}: {e}");
         return(ComicLocation.NotFound);
     }
 }