当前位置: 首页>>代码示例>>C#>>正文


C# Entry.ToFile方法代码示例

本文整理汇总了C#中Entry.ToFile方法的典型用法代码示例。如果您正苦于以下问题:C# Entry.ToFile方法的具体用法?C# Entry.ToFile怎么用?C# Entry.ToFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Entry的用法示例。


在下文中一共展示了Entry.ToFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Task5_CloneMedia

        public Task5_CloneMedia(MyNamedTasks Tasks)
            : base(Tasks, "Task5_CloneMedia")
        {
            var NamedTasks = Tasks;

            this.Description = @"
            Clone poster to imgbay.
            ";

            this.YieldWork =
                (Task, Input) =>
                {
                    var Entry = new Entry().FromFile(Input);

                    Input.Delete();

                    if (string.IsNullOrEmpty(Entry.TinEyeHash))
                    {
                        #region TinEyeHash
                        AppendLog("in " + Entry.PirateBay.Name + " without tineye");

                        BasicTinEyeSearch.Search(Entry.IMDB.MediumPosterImage,
                            h =>
                            {
                                AppendLog("as " + h.Hash);

                                Entry.TinEyeHash = h.Hash;
                                Entry.ToFile(Input);
                            }
                        );
                        #endregion
                    }
                    else if (string.IsNullOrEmpty(Entry.BayImgKey))
                    {
                        #region BayImgKey
                        AppendLog("in " + Entry.PirateBay.Name + " without bayimg");

                        // do we have it in memory?

                        var BayImg = this.Memory[Entry.TinEyeHash].FirstDirectoryOrDefault();

                        if (BayImg == null)
                        {
                            BasicPirateBayImage.Clone(new Uri(Entry.TinEyeImageLink),
                                e =>
                                {
                                    Entry.BayImgKey = e.Key;
                                    Entry.ToFile(Input);

                                    BayImg = this.Memory[Entry.TinEyeHash].CreateSubdirectory(e.Key);
                                    AppendLog("in " + Entry.PirateBay.Name + " now known as " + Entry.BayImgKey);
                                }
                            );
                        }
                        else
                        {
                            Entry.BayImgKey = BayImg.Name;
                            Entry.ToFile(Input);

                            AppendLog("in " + Entry.PirateBay.Name + " already known as " + Entry.BayImgKey);
                        }
                        #endregion

                    }
                    else if (string.IsNullOrEmpty(Entry.YouTubeKey))
                    {
                        AppendLog("in " + Entry.PirateBay.Name + " looking for video...");

                        BasicGoogleVideoCrawler.Search(Entry.YouTubeQuery,
                            (v, src) =>
                            {
                                AppendLog("as " + v);

                                Entry.YouTubeKey = v;
                                Entry.ToFile(Input);
                            }
                        );
                    }
                    else
                    {
                        var NextWork = NamedTasks.Task6_MediaCollector.AddWork(5, Entry.PirateBay.Hash);

                        if (NextWork.Exists)
                            AppendLog("out already exists " + Entry.PirateBay.Name + " as " + Entry.PirateBay.Hash);
                        else
                        {
                            AppendLog("out " + Entry.PirateBay.Name + " as " + Entry.PirateBay.Hash);

                            Entry.ToFile(NextWork);
                        }
                    }

                    // if we fail, we this work item will not be retried
                    //Input.Delete();

                    return delegate
                    {
                        // this will be called if the task is still active
                    };
                };
//.........这里部分代码省略.........
开发者ID:BGCX261,项目名称:zmovies-svn-to-git,代码行数:101,代码来源:Task5_CloneMedia.cs


注:本文中的Entry.ToFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。