diff --git a/Tumbl Tool/Image Ripper/ImageRipper.cs b/Tumbl Tool/Image Ripper/ImageRipper.cs index d98f1ed..1a9f5b6 100644 --- a/Tumbl Tool/Image Ripper/ImageRipper.cs +++ b/Tumbl Tool/Image Ripper/ImageRipper.cs @@ -143,7 +143,7 @@ public void generateImageListForDownload(HashSet posts) removeHash.UnionWith(new HashSet((from p in imageList where p.filename.ToLower().EndsWith(".png") select p))); } - this.imageList.RemoveWhere(x => removeHash.Any(y => x.filename == y.filename)); + this.imageList.RemoveWhere(x => removeHash.Contains(x)); } public HashSet getTumblrPostList(int start = 0) @@ -160,9 +160,10 @@ public HashSet getTumblrPostList(int start = 0) query = JSONHelper.getQueryString(this.tumblrDomain, tumblrPostTypes.photo.ToString(), start); } - if (this.crawlManager.isValidTumblr(@query)) + this.crawlManager.getDocument(query); + + if (this.crawlManager.jsonDocument != null) { - this.crawlManager.getDocument(query); HashSet posts = crawlManager.getPostList(tumblrPostTypes.photo.ToString(), apiMode); return posts; } @@ -260,9 +261,9 @@ public TumblrBlog parseBlogPosts(int parseMode) { HashSet posts = getTumblrPostList(i); - HashSet existingHash = new HashSet((from p in posts where this.existingImageList.Any(s => s.ToLower() == p.photos.First().filename.ToLower()) select p)); + HashSet existingHash = new HashSet((from p in posts where this.existingImageList.Contains(p.photos.First().filename.ToLower()) select p)); - posts.RemoveWhere(x => existingHash.Any(y => x.id == y.id)); + posts.RemoveWhere(x => existingHash.Contains(x)); this.blog.posts.UnionWith(posts); this.parsedPosts += posts.Count; diff --git a/Tumbl Tool/Managers/CrawlManager.cs b/Tumbl Tool/Managers/CrawlManager.cs index a995596..f8df21a 100644 --- a/Tumbl Tool/Managers/CrawlManager.cs +++ b/Tumbl Tool/Managers/CrawlManager.cs @@ -52,6 +52,16 @@ public void getJSONDocument(string url) try { this.jsonDocument = JSONHelper.getJSONObject(url); + + if ((this.jsonDocument != null && this.jsonDocument.meta != null && this.jsonDocument.meta.status == ((int)tumblrAPIResponseEnum.OK).ToString())) + { + + } + + else + { + this.jsonDocument = null; + } } catch {