@@ -38,14 +38,18 @@ private struct IqdbResult : ISearchResult
3838
3939 public string Url { get ; set ; }
4040
41- public float ? Similarity { get ; set ; }
42- public string ? Artist { get ; set ; }
41+ public float ? Similarity { get ; set ; }
42+
43+ public string ? Artist { get ; set ; }
44+
4345 public string ? Characters { get ; set ; }
44- public string ? SiteName { get ; set ; }
4546
46- public IqdbResult ( string siteName , string source , string url , int width , int height , float ? similarity )
47+ public string ? SiteName { get ; set ; }
48+
49+ public IqdbResult ( string siteName , string source , string url , int width , int height , float ? similarity ,
50+ string ? caption )
4751 {
48- SiteName = siteName ;
52+ SiteName = siteName ;
4953 Url = url ;
5054 Source = source ;
5155 Width = width ;
@@ -54,7 +58,7 @@ public IqdbResult(string siteName, string source, string url, int width, int hei
5458 Filter = false ; // set later
5559 Artist = null ;
5660 Characters = null ;
57- Caption = null ;
61+ Caption = caption ;
5862 }
5963 }
6064
@@ -91,27 +95,27 @@ private IqdbResult ParseResult(HtmlNodeCollection tr)
9195 var wh = res . InnerText . Split ( Formatting . MUL_SIGN ) ;
9296
9397 var wStr = wh [ 0 ] . SelectOnlyDigits ( ) ;
94- w = int . Parse ( wStr ) ;
98+ w = Int32 . Parse ( wStr ) ;
9599
96100 // May have NSFW caption, so remove it
97101
98102 var hStr = wh [ 1 ] . SelectOnlyDigits ( ) ;
99- h = int . Parse ( hStr ) ;
103+ h = Int32 . Parse ( hStr ) ;
100104 }
101105
102106 float ? sim ;
103107
104108 if ( tr . Count >= 5 ) {
105109 var simNode = tr [ 4 ] ;
106110 var simStr = simNode . InnerText . Split ( '%' ) [ 0 ] ;
107- sim = float . Parse ( simStr ) ;
111+ sim = Single . Parse ( simStr ) ;
108112 }
109113 else {
110114 sim = null ;
111115 }
112116
113117
114- var i = new IqdbResult ( src . InnerText , null , url , w , h , sim ) ;
118+ var i = new IqdbResult ( src . InnerText , null , url , w , h , sim , caption . InnerText ) ;
115119 i . Filter = i . Similarity < FilterThreshold ;
116120 return i ;
117121 }
@@ -122,7 +126,7 @@ public override FullSearchResult GetResult(string url)
122126
123127 try {
124128
125- var html = Network . GetSimpleResponse ( sr . RawUrl ) ;
129+ var html = Network . GetSimpleResponse ( sr . RawUrl ! ) ;
126130
127131 //Network.WriteResponse(html);
128132
0 commit comments