private async Task <IBlog> CheckIfBlogIsHiddenTumblrBlogAsync(IBlog blog) { if (blog.GetType() == typeof(TumblrBlog) && await _tumblrBlogDetector.IsHiddenTumblrBlogAsync(blog.Url)) { RemoveBlog(new[] { blog }); blog = TumblrHiddenBlog.Create("https://www.tumblr.com/dashboard/blog/" + blog.Name, Path.Combine(_shellService.Settings.DownloadLocation, "Index")); } return(blog); }
private async Task <IBlog> CheckIfBlogIsHiddenTumblrBlogAsync(IBlog blog) { if (blog.GetType() == typeof(TumblrBlog) && await _tumblrBlogDetector.IsHiddenTumblrBlogAsync(blog.Url)) { RemoveBlog(new[] { blog }, false); blog = TumblrHiddenBlog.Create("https://www.tumblr.com/dashboard/blog/" + blog.Name, GetIndexFolderPath(_shellService.Settings.ActiveCollectionId), _shellService.Settings.FilenameTemplate); } return(blog); }
public ICrawler GetCrawler(IBlog blog) { Lazy <ICrawler, ICrawlerData> downloader = DownloaderFactoryLazy.FirstOrDefault(list => list.Metadata.BlogType == blog.GetType()); if (downloader != null) { return(downloader.Value); } throw new ArgumentException("Website is not supported!", nameof(blog)); }
public Lazy <IDetailsViewModel> GetViewModel(IBlog blog) { Lazy <IDetailsViewModel, ICrawlerData> viewModel = ViewModelFactoryLazy.FirstOrDefault(list => list.Metadata.BlogType == blog.GetType()); if (viewModel != null) { return(viewModel); } throw new ArgumentException("Website is not supported!", "blogType"); }