aboutsummaryrefslogtreecommitdiff
path: root/import/src/plugins/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'import/src/plugins/mod.rs')
-rw-r--r--import/src/plugins/mod.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/import/src/plugins/mod.rs b/import/src/plugins/mod.rs
index 3aeefdf..095fd39 100644
--- a/import/src/plugins/mod.rs
+++ b/import/src/plugins/mod.rs
@@ -15,19 +15,20 @@ pub mod vgmdb;
pub mod wikidata;
pub mod wikimedia_commons;
-use crate::{ApiSecrets, InheritedFlags};
+use crate::{ApiSecrets, DatabaseTables, InheritedFlags};
use anyhow::Result;
-use jellycommon::{Node, NodeID};
-use jellydb::Database;
+use jellycommon::jellyobject::Object;
+use jellydb::table::{RowNum, Table};
use jellyremuxer::matroska::Segment;
use std::{collections::HashSet, path::Path, sync::Mutex};
use tokio::runtime::Handle;
pub struct ImportContext<'a> {
- pub db: &'a Database,
+ pub dba: DatabaseTables,
+ pub nodes: &'a Table,
pub rt: &'a Handle,
pub iflags: InheritedFlags,
- pub nodes: &'a Mutex<HashSet<NodeID>>,
+ pub pending_nodes: &'a Mutex<HashSet<RowNum>>,
}
#[derive(Default, Clone, Copy)]
@@ -41,19 +42,19 @@ pub struct PluginInfo {
pub trait ImportPlugin: Send + Sync {
fn info(&self) -> PluginInfo;
- fn file(&self, ct: &ImportContext, parent: NodeID, path: &Path) -> Result<()> {
+ fn file(&self, ct: &ImportContext, parent: RowNum, path: &Path) -> Result<()> {
let _ = (ct, parent, path);
Ok(())
}
- fn media(&self, ct: &ImportContext, node: NodeID, path: &Path, seg: &Segment) -> Result<()> {
+ fn media(&self, ct: &ImportContext, node: RowNum, path: &Path, seg: &Segment) -> Result<()> {
let _ = (ct, node, path, seg);
Ok(())
}
- fn instruction(&self, ct: &ImportContext, node: NodeID, line: &str) -> Result<()> {
+ fn instruction(&self, ct: &ImportContext, node: RowNum, line: &str) -> Result<()> {
let _ = (ct, node, line);
Ok(())
}
- fn process(&self, ct: &ImportContext, node: NodeID, data: &Node) -> Result<()> {
+ fn process(&self, ct: &ImportContext, node: RowNum, data: Object<'_>) -> Result<()> {
let _ = (ct, node, data);
Ok(())
}