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


C# ReleaseInfo.ToString方法代码示例

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


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

示例1: PerformQuery


//.........这里部分代码省略.........
                                            release.Peers += release.Seeders;
                                        break;
                                    case "date":
                                        release.PublishDate = DateTimeUtil.FromUnknown(value);
                                        break;
                                    case "files":
                                        release.Files = ParseUtil.CoerceLong(value);
                                        break;
                                    case "grabs":
                                        release.Grabs = ParseUtil.CoerceLong(value);
                                        break;
                                    case "downloadvolumefactor":
                                        release.DownloadVolumeFactor = ParseUtil.CoerceDouble(value);
                                        break;
                                    case "uploadvolumefactor":
                                        release.UploadVolumeFactor = ParseUtil.CoerceDouble(value);
                                        break;
                                    case "minimumratio":
                                        release.MinimumRatio = ParseUtil.CoerceDouble(value);
                                        break;
                                    case "minimumseedtime":
                                        release.MinimumSeedTime = ParseUtil.CoerceLong(value);
                                        break;
                                    case "imdb":
                                        Regex IMDBRegEx = new Regex(@"(\d+)", RegexOptions.Compiled);
                                        var IMDBMatch = IMDBRegEx.Match(value);
                                        var IMDBId = IMDBMatch.Groups[1].Value;
                                        release.Imdb = ParseUtil.CoerceLong(IMDBId);
                                        break;
                                    case "rageid":
                                        Regex RageIDRegEx = new Regex(@"(\d+)", RegexOptions.Compiled);
                                        var RageIDMatch = RageIDRegEx.Match(value);
                                        var RageID = RageIDMatch.Groups[1].Value;
                                        release.RageID = ParseUtil.CoerceLong(RageID);
                                        break;
                                    case "tvdbid":
                                        Regex TVDBIdRegEx = new Regex(@"(\d+)", RegexOptions.Compiled);
                                        var TVDBIdMatch = TVDBIdRegEx.Match(value);
                                        var TVDBId = TVDBIdMatch.Groups[1].Value;
                                        release.TVDBId = ParseUtil.CoerceLong(TVDBId);
                                        break;
                                    case "banner":
                                        if(!string.IsNullOrWhiteSpace(value)) { 
                                            var bannerurl = resolvePath(value);
                                            release.BannerUrl = bannerurl;
                                        }
                                        break;
                                    default:
                                        break;
                                }
                            }
                            catch (Exception ex)
                            {
                                if (OptionalFileds.Contains(Field.Key))
                                    continue;
                                throw new Exception(string.Format("Error while parsing field={0}, selector={1}, value={2}: {3}", Field.Key, Field.Value.Selector, value, ex.Message));
                            }
                        }

                        // if DateHeaders is set go through the previous rows and look for the header selector
                        var DateHeaders = Definition.Search.Rows.Dateheaders;
                        if (release.PublishDate == null && DateHeaders != null)
                        {
                            var PrevRow = Row.PreviousElementSibling;
                            string value = null;
                            while (PrevRow != null)
                            {
                                try
                                {
                                    value = handleSelector(DateHeaders, PrevRow);
                                    break;
                                }
                                catch (Exception)
                                {
                                    // do nothing
                                }
                                PrevRow = PrevRow.PreviousElementSibling;
                            }
                            
                            if (value == null)
                                throw new Exception(string.Format("No date header row found for {0}", release.ToString()));

                            release.PublishDate = DateTimeUtil.FromUnknown(value);
                        }

                        releases.Add(release);
                    }
                    catch (Exception ex)
                    {
                        logger.Error(string.Format("CardigannIndexer ({0}): Error while parsing row '{1}': {2}", ID, Row.OuterHtml, ex));
                    }
                }
            }
            catch (Exception ex)
            {
                OnParseError(results, ex);
            }

            return releases;
        }
开发者ID:Jackett,项目名称:Jackett,代码行数:101,代码来源:CardigannIndexer.cs


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