Ejemplo n.º 1
0
        public static void Clone(Uri source, Action <Entry> AddEntry)
        {
            var t = new BasicPirateBayImage();

            t.AddEntry += AddEntry;

            t.Clone(source);
        }
Ejemplo n.º 2
0
        public static void Search(string Key, MemoryDirectory memory, Action <Entry, BasicTinEyeSearch.Entry, BasicPirateBayImage.Entry> AddEntry)
        {
            Search(Key,
                   imdb =>
            {
                var _tineye = default(BasicTinEyeSearch.Entry);
                var _bayimg = default(BasicPirateBayImage.Entry);

                BasicTinEyeSearch.Search(imdb.MediumPosterImage,
                                         tineye =>
                {
                    _tineye = tineye;

                    var tineye_memory = default(DirectoryInfo);
                    var bayimg_memory = default(DirectoryInfo);

                    if (memory != null)
                    {
                        tineye_memory = memory[tineye.Hash];
                        bayimg_memory = tineye_memory.FirstDirectoryOrDefault();

                        if (bayimg_memory != null)
                        {
                            _bayimg = new BasicPirateBayImage.Entry(bayimg_memory.Name);
                        }
                    }

                    if (_bayimg == null)
                    {
                        Native.API.set_time_limit(5);

                        BasicPirateBayImage.Clone(tineye.QueryLink.ToUri(),
                                                  bayimg =>
                        {
                            _bayimg = bayimg;

                            if (tineye_memory != null)
                            {
                                bayimg_memory = tineye_memory.CreateSubdirectory(bayimg.Key);
                            }
                        }
                                                  );
                    }
                }
                                         );

                AddEntry(imdb, _tineye, _bayimg);
            }
                   );
        }
        public static void Clone(Uri source, Action<Entry> AddEntry)
        {
            var t = new BasicPirateBayImage();

            t.AddEntry += AddEntry;

            t.Clone(source);
        }