aboutsummaryrefslogtreecommitdiff
path: root/import/src/plugins/infojson.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-02-05 21:17:54 +0100
committermetamuffin <metamuffin@disroot.org>2026-02-05 21:17:54 +0100
commit8ec94477fb5efae62dcfee31cede87eb400bf02d (patch)
treee36ec2227076a8857495647f6abcb9883f154d6f /import/src/plugins/infojson.rs
parent65ca3f3450d0067668111f6e13cc3089768c9efe (diff)
downloadjellything-8ec94477fb5efae62dcfee31cede87eb400bf02d.tar
jellything-8ec94477fb5efae62dcfee31cede87eb400bf02d.tar.bz2
jellything-8ec94477fb5efae62dcfee31cede87eb400bf02d.tar.zst
migrate import to new db trait
Diffstat (limited to 'import/src/plugins/infojson.rs')
-rw-r--r--import/src/plugins/infojson.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/import/src/plugins/infojson.rs b/import/src/plugins/infojson.rs
index e03a5f7..3a48ce8 100644
--- a/import/src/plugins/infojson.rs
+++ b/import/src/plugins/infojson.rs
@@ -7,7 +7,7 @@ use crate::plugins::{ImportPlugin, PluginContext, PluginInfo};
use anyhow::{Context, Result, anyhow};
use chrono::{Utc, format::Parsed};
use jellycommon::*;
-use jellydb::table::RowNum;
+use jellydb::RowNum;
use jellyremuxer::matroska::{AttachedFile, Segment};
use log::info;
use serde::{Deserialize, Serialize};
@@ -176,7 +176,7 @@ impl ImportPlugin for Infojson {
let title = clean_uploader_name(&data.title);
ct.dba.db.transaction(&mut |txn| {
- let mut node = ct.dba.nodes.get(txn, parent)?.unwrap();
+ let mut node = txn.get(parent)?.unwrap();
node = node.as_object().insert(NO_KIND, KIND_CHANNEL);
node = node.as_object().insert(NO_TITLE, title);
if let Some(cid) = &data.channel_id {
@@ -198,7 +198,7 @@ impl ImportPlugin for Infojson {
});
}
- ct.dba.nodes.update(txn, parent, node)
+ txn.update(parent, node)
})
}
@@ -237,7 +237,7 @@ impl ImportPlugin for Infojson {
};
ct.dba.db.transaction(&mut |txn| {
- let mut node = ct.dba.nodes.get(txn, row)?.unwrap();
+ let mut node = txn.get(row)?.unwrap();
node = node.as_object().insert(NO_KIND, kind);
node = node.as_object().insert(NO_TITLE, &infojson.title);
if let Some(title) = &infojson.alt_title
@@ -290,7 +290,7 @@ impl ImportPlugin for Infojson {
_ => (),
};
- ct.dba.nodes.update(txn, row, node)
+ txn.update(row, node)
})?;
}
Ok(())