Simplified extract_images query value logic

This commit is contained in:
Thorsten Sommer 2026-05-12 20:30:13 +02:00
parent 7afb308e5c
commit da50d69210
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -8,8 +8,7 @@ public sealed partial class RustService
public async Task<string> ReadArbitraryFileData(string path, int maxChunks, bool extractImages = false) public async Task<string> ReadArbitraryFileData(string path, int maxChunks, bool extractImages = false)
{ {
var streamId = Guid.NewGuid().ToString(); var streamId = Guid.NewGuid().ToString();
var extractImagesQueryValue = extractImages ? "true" : "false"; var requestUri = $"/retrieval/fs/extract?path={Uri.EscapeDataString(path)}&stream_id={streamId}&extract_images={extractImages}";
var requestUri = $"/retrieval/fs/extract?path={Uri.EscapeDataString(path)}&stream_id={streamId}&extract_images={extractImagesQueryValue}";
var request = new HttpRequestMessage(HttpMethod.Get, requestUri); var request = new HttpRequestMessage(HttpMethod.Get, requestUri);
var response = await this.http.SendAsync(request, HttpCompletionOption.ResponseHeadersRead); var response = await this.http.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);