/// <summary> /// Returns false if the supplied Imgur Comment has already been processed. /// This is determined by checking the direct Replies to the Comment, /// and seeing if any of them were made by the application, /// specifically if <see cref="ImgurInterfacer.isCommentByThisApplication"/> returns true. /// This method may call the Imgur API. /// </summary> protected async Task <bool> ShouldProcess(IComment ToProcess) { IEnumerable <IComment> Replies; //??? Imgur seems inconsistent in whether or not Comment Replies are included if (ToProcess.Children.Count() > 0) { Replies = ToProcess.Children; } else { Log.Imgur_.LogVerbose("No sub-Comments found in model of Comment #{0:D}; lazily loading sub-Comments", ToProcess.Id); try{ Replies = await Imgur.ReadCommentReplies(ToProcess); }catch (ImgurException Error) { Log.Imgur_.LogError( "Unable to retrieve replies for Comment with ID {0:D} (by '{1}' on {2:u}) to determine if it has been processed; skipping Comment. Details: {3}", ToProcess.Id, ToProcess.Author, ToProcess.DateTime, Error.Message ); return(false); } } if (Replies.Any( C => Imgur.isCommentByThisApplication(C) )) { return(false); } return(true); }