public FileQueueStateInfo(string md5, AniWrap.DataTypes.PostFile pf) { this.ForceStop = false; this.Hash = md5; this.Ext = pf.ext; this.FileName = pf.filename; this.PostFile = pf; this.Status = DownloadStatus.Queued; this.RetryCount = 0; }
public static void MarkPost(string hash, AniWrap.DataTypes.PostFile p) { lock (g) { FileIndexInfo w = null; if (file_index.ContainsKey(hash)) { w = file_index[hash]; } else { w = new FileIndexInfo(hash); file_index.Add(hash, w); } w.MarkPost(p.board, p.owner.OwnerThread.ID, p.owner.ID, p.filename + "." + p.ext); need_save = true; } }
public bool Detect(AniWrap.DataTypes.GenericPost post) { return matcher.IsMatch(post.Email); }
public bool Detect(AniWrap.DataTypes.GenericPost post) { return matcher.IsMatch(post.CommentText); }
public bool Detect(AniWrap.DataTypes.GenericPost post) { if (post.File != null) { return matcher.IsMatch(post.File.filename); } else { return false; } }
public bool Detect(AniWrap.DataTypes.GenericPost post) { if (post.File != null) { // 4chan hash or md5 hash??????? return post.File.hash == this.FilterText; } else { return false; } }
private bool can_i_run(AniWrap.DataTypes.GenericPost po) { if (this.AddedAutomatically) { //if the container board is in monitor mode, we need to see //if this thread has a matching filter //otherwise we should not start it. if (this.Board.Mode == BoardWatcher.BoardMode.Monitor) { return this.Board.MatchFilters(po); } else { return true; } } else { return true; } }
public bool MatchFilters(AniWrap.DataTypes.GenericPost post) { for (int i = 0; i < this.my_filters.Count(); i++) { try { if (my_filters[i].Detect(post)) { return true; } } catch (Exception) { } } return false; }
public static void MarkPostAsync(string hash, AniWrap.DataTypes.PostFile p) { (new Thread(() => { MarkPost(hash, p); })).Start(); }