about summary refs log tree commit diff
path: root/src/database/file
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-08-28 14:17:24 +0300
committerVika <vika@fireburn.ru>2024-08-28 14:17:24 +0300
commit67e4e83d1cbf984f4a801e7245a2aeec66efe522 (patch)
tree855eed71e52d4dc2eb6f3281c39e7d96207fe7cb /src/database/file
parent2e750309983b67e5baadeb4109960e8637c1c894 (diff)
downloadkittybox-67e4e83d1cbf984f4a801e7245a2aeec66efe522.tar.zst
Make Micropub update logic self-contained
This allows for a separation of concerns between database backends and
Micropub, unless such backend have special requirements, like the file
backend storing children of a feed in an array.
Diffstat (limited to 'src/database/file')
-rw-r--r--src/database/file/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/database/file/mod.rs b/src/database/file/mod.rs
index 10d6079..cf7380f 100644
--- a/src/database/file/mod.rs
+++ b/src/database/file/mod.rs
@@ -466,7 +466,9 @@ impl Storage for FileStorage {
             file.read_to_string(&mut content).await?;
             let json: serde_json::Value = serde_json::from_str(&content)?;
             drop(file);
-            // Apply the editing algorithms
+            // Apply the editing algorithms. We can't use the stock
+            // `update.apply` function due to special requirements of
+            // the file backend, so we're implementing our own.
             let new_json = modify_post(&json, update)?;
 
             temp.write_all(new_json.to_string().as_bytes()).await?;