From 81e68b58a0f5ca7e48ebf373c5540780adf1a0c8 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 28 Jun 2025 22:30:53 +0200 Subject: [PATCH] Formatting --- .../Components/ReadFileContent.razor.cs | 1 - runtime/src/file_data.rs | 21 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/MindWork AI Studio/Components/ReadFileContent.razor.cs b/app/MindWork AI Studio/Components/ReadFileContent.razor.cs index 475dbaa9..86bafebe 100644 --- a/app/MindWork AI Studio/Components/ReadFileContent.razor.cs +++ b/app/MindWork AI Studio/Components/ReadFileContent.razor.cs @@ -26,7 +26,6 @@ public partial class ReadFileContent : MSGComponentBase return; var ext = Path.GetExtension(selectedFile.SelectedFilePath).TrimStart('.'); - if (Array.Exists(FileTypeFilter.Executables.FilterExtensions, x => x.Equals(ext, StringComparison.OrdinalIgnoreCase))) { await MessageBus.INSTANCE.SendError(new(Icons.Material.Filled.AppBlocking, T("Executables are not allowed"))); diff --git a/runtime/src/file_data.rs b/runtime/src/file_data.rs index 3effdbeb..b52efed2 100644 --- a/runtime/src/file_data.rs +++ b/runtime/src/file_data.rs @@ -28,11 +28,22 @@ pub struct Chunk { #[derive(Debug, Serialize)] pub enum Metadata { - Text { line_number: usize }, - Pdf { page_number: usize }, - Spreadsheet { sheet_name: String, row_number: usize }, + Text { + line_number: usize + }, + + Pdf { + page_number: usize + }, + + Spreadsheet { + sheet_name: String, + row_number: usize, + }, + Document {}, Image {}, + Presentation { slide_number: u32, image: Option, @@ -72,7 +83,7 @@ pub async fn extract_data(_token: APIToken, path: String, mut end: Shutdown) -> chunk = stream.next() => match chunk { Some(Ok(chunk)) => chunk, Some(Err(e)) => { - yield Event::json(&format!("Error: {}", e)); + yield Event::json(&format!("Error: {e}")); break; }, None => break, @@ -85,7 +96,7 @@ pub async fn extract_data(_token: APIToken, path: String, mut end: Shutdown) -> }, Err(e) => { - yield Event::json(&format!("Error starting stream: {}", e)); + yield Event::json(&format!("Error starting stream: {e}")); } } }