use std::rc::Rc;
use std::sync::atomic::{AtomicU64, Ordering};
use std::time::SystemTime;
-use sea_orm::{NotSet, Set};
+use sea_orm::{Iden, NotSet, Set};
use sea_orm::sea_query::prelude::Utc;
use backend::backend::{BackendHandle, BroadcastMessage, NoteContentRet, NoteId, NoteTitleUpdate, SaveNoteResult};
use backend::lockmanager::NoteLock;
NoteId::TmpId(_) => (NotSet, Set(Utc::now().into()))
};
+ let content_type = match self.kind {
+ NoteType::MDTextNote => "text/markdown",
+ _ => "text/plain"
+ };
+
let note = entity::note::ActiveModel {
note_id: note_id.clone(),
collection_id: Set(self.collection_id),
nodename: if let Some(nodename) = &self.nodename { Set(nodename.clone())} else { NotSet },
kind: Set(self.kind.clone()),
title: Set(title),
+ content_type: Set(content_type.to_string()),
lastmodified: Set(Utc::now().into()),
created: created,
fixed_title: Set(self.fixed_title),
pub kind: NoteType,
pub title: String,
+ pub content_type: String,
pub lastmodified: DateTimeWithTimeZone,
pub created: DateTimeWithTimeZone,
nodename: "".to_string(),
kind: Default::default(),
title: Default::default(),
+ content_type: Default::default(),
lastmodified: Default::default(),
created: Default::default(),
fixed_title: false,