some changes
This commit is contained in:
+16
-12
@@ -162,16 +162,6 @@ pub struct MarkdownFileReference {
|
||||
mime_type: String,
|
||||
}
|
||||
|
||||
impl From<db::NoteFile> for MarkdownFileReference {
|
||||
fn from(file: db::NoteFile) -> Self {
|
||||
Self {
|
||||
filename: file.filename,
|
||||
url: file.url,
|
||||
mime_type: file.mime_type,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn markdown_file_references(
|
||||
state: &SharedState,
|
||||
pad_id: Option<i64>,
|
||||
@@ -189,10 +179,24 @@ pub(crate) async fn markdown_file_references(
|
||||
.into_iter()
|
||||
.filter(|file| {
|
||||
content
|
||||
.map(|value| files::content_references_file(value, &file.filename, &file.url))
|
||||
.map(|value| {
|
||||
files::content_references_stored_file(
|
||||
value,
|
||||
&file.filename,
|
||||
&file.url,
|
||||
state.files_public_url.as_deref(),
|
||||
)
|
||||
})
|
||||
.unwrap_or(true)
|
||||
})
|
||||
.map(Into::into)
|
||||
.map(|file| MarkdownFileReference {
|
||||
filename: file.filename,
|
||||
url: crate::file_urls::public_file_url(
|
||||
state.files_public_url.as_deref(),
|
||||
&file.url,
|
||||
),
|
||||
mime_type: file.mime_type,
|
||||
})
|
||||
.collect())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user