Skip to content

Commit b14eb2d

Browse files
committed
misc
1 parent 63d895c commit b14eb2d

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

SmartImage.Lib/Engines/BaseSearchEngine.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public abstract class BaseSearchEngine
1717
protected BaseSearchEngine(string baseUrl)
1818
{
1919
BaseUrl = baseUrl;
20-
20+
2121
}
2222

2323
public string BaseUrl { get; }
@@ -32,7 +32,7 @@ protected BaseSearchEngine(string baseUrl)
3232

3333
public virtual SearchResult GetResult(ImageQuery query)
3434
{
35-
var rawUrl = GetRawResultUrl(query);
35+
var rawUrl = GetRawResultUri(query);
3636

3737
var sr = new SearchResult(this);
3838

@@ -48,6 +48,8 @@ public virtual SearchResult GetResult(ImageQuery query)
4848
return sr;
4949
}
5050

51+
52+
5153
public async Task<SearchResult> GetResultAsync(ImageQuery query)
5254
{
5355

@@ -65,10 +67,10 @@ public async Task<SearchResult> GetResultAsync(ImageQuery query)
6567
return await task;
6668
}
6769

68-
public Uri GetRawResultUrl(ImageQuery query)
70+
public Uri GetRawResultUri(ImageQuery query)
6971
{
7072
var uri = new Uri(BaseUrl + query.UploadUri);
71-
73+
7274
bool ok = Network.IsUriAlive(uri, Timeout);
7375

7476
if (!ok) {

SmartImage.Lib/Engines/InterpretedSearchEngine.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public override SearchResult GetResult(ImageQuery query)
4646
}
4747

4848
return sr;
49+
4950
}
5051

5152
protected virtual IDocument GetDocument(SearchResult sr)

SmartImage.Lib/SearchClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public SearchClient(SearchConfig config)
3030
{
3131
Config = config;
3232

33-
Results = new List<SearchResult>();
33+
Results = new List<SearchResult>();
3434

3535
FilteredResults = new List<SearchResult>();
3636

@@ -77,7 +77,7 @@ public void Reload()
7777
.ToArray();
7878

7979
Trace.WriteLine($"Engines: {Config.SearchEngines} | {Engines.QuickJoin()}");
80-
80+
8181

8282
}
8383

SmartImage.Lib/Searching/ImageResult.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using Novus.Win32;
1414
using SimpleCore.Model;
1515
using SimpleCore.Net;
16+
// ReSharper disable CognitiveComplexity
1617

1718
#nullable enable
1819

SmartImage.Lib/Utilities/ImageHelper.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ public static bool IsDirect(string url, DirectImageType directType = DirectImage
110110
}
111111

112112

113-
114113
/// <summary>
115114
/// Scans for direct images within a webpage.
116115
/// </summary>
@@ -122,8 +121,8 @@ public static bool IsDirect(string url, DirectImageType directType = DirectImage
122121
/// <param name="readImage">Whether to read image metadata</param>
123122
/// <param name="imageFilter">Filter criteria for images (applicable iff <paramref name="readImage"/> is <c>true</c>)</param>
124123
public static List<DirectImage> FindDirectImages(string url, DirectImageType directType = DirectImageType.Regex,
125-
int count=5, int fragmentSize=10, double pingTimeSec=1,
126-
bool readImage=true, Predicate<Image> imageFilter=null)
124+
int count = 5, int fragmentSize = 10, double pingTimeSec = 1,
125+
bool readImage = true, Predicate<Image> imageFilter = null)
127126
{
128127

129128

@@ -175,18 +174,18 @@ public static List<DirectImage> FindDirectImages(string url, DirectImageType dir
175174
{
176175

177176
foreach (string currentUrl in fragments[iCopy]) {
178-
177+
179178
if (directImages.Count >= count) {
180179
return;
181180
}
182181

183-
if (!Network.IsUri(currentUrl, out var uri))
182+
if (!Network.IsUri(currentUrl, out var uri))
184183
continue;
185184

186-
if (!Network.IsUriAlive(uri, pingTime))
185+
if (!Network.IsUriAlive(uri, pingTime))
187186
continue;
188187

189-
if (!IsDirect(currentUrl, directType))
188+
if (!IsDirect(currentUrl, directType))
190189
continue;
191190

192191
var di = new DirectImage
@@ -235,6 +234,7 @@ public static List<DirectImage> FindDirectImages(string url, DirectImageType dir
235234

236235
Task.WaitAll(tasks.ToArray());
237236

237+
238238
return directImages;
239239

240240
}

SmartImage/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
using SmartImage.Lib.Searching;
3838
using SmartImage.Lib.Utilities;
3939
using SmartImage.Utilities;
40+
// ReSharper disable CognitiveComplexity
4041

4142
namespace SmartImage
4243
{

0 commit comments

Comments
 (0)