use std::io::{Error, ErrorKind};
use std::path::{Path, PathBuf};
use std::pin::Pin;
-use sea_orm::{ActiveModelTrait, Database, DatabaseConnection, EntityTrait, QueryFilter, ColumnTrait, Set, QueryOrder, DbErr, ExprTrait, QuerySelect, NotSet};
+use sea_orm::{ActiveModelTrait, Database, DatabaseConnection, EntityTrait, QueryFilter, ColumnTrait, Set, QueryOrder, DbErr, ExprTrait, QuerySelect};
use tokio::runtime::Runtime;
use std::sync::{Arc};
use std::thread::JoinHandle;
where F: FnOnce(Result<(attachment::Model, attachmentcontent::Model), DbErr>) + Send + 'static {
let backend = self.backend.clone();
let pathbuf = path.to_path_buf();
- let name = pathbuf.file_name();
let Some(name) = pathbuf.file_name() else {
callback(Err(DbErr::Custom("invalid path".to_string())));
return;
if let EventType::FileList(file_selection) = event.event_type && let Some(file) = file_selection.get(0) {
let path = Path::new(file);
backend.add_note_attachment(note_id, path, move|result|{
- proxy.call_mainthread(|_doc, note|{
+ proxy.call_mainthread(|_doc, _note|{
match result {
Ok((attachment, content)) => {
println!("attachment: {} id: {}", attachment.attachment_id, content.attachment_id);