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;
        }
Example #2
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;
            }
        }
Example #3
0
 public bool Detect(AniWrap.DataTypes.GenericPost post)
 {
     return matcher.IsMatch(post.Email);
 }
Example #4
0
 public bool Detect(AniWrap.DataTypes.GenericPost post)
 {
     return matcher.IsMatch(post.CommentText);
 }
Example #5
0
 public bool Detect(AniWrap.DataTypes.GenericPost post)
 {
     if (post.File != null)
     {
         return matcher.IsMatch(post.File.filename);
     }
     else
     {
         return false;
     }
 }
Example #6
0
 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;
     }
 }
Example #7
0
 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;
     }
 }
Example #8
0
        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;
        }
Example #9
0
 public static void MarkPostAsync(string hash, AniWrap.DataTypes.PostFile p)
 {
     (new Thread(() =>
     {
         MarkPost(hash, p);
     })).Start();
 }